fix: double registration panic in auth fallback (#107330)

fix double registration panic in auth fallback
pull/107354/head
Will Assis 3 weeks ago committed by GitHub
parent c48a1aba40
commit 930c9b3beb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      pkg/storage/unified/sql/service.go

@ -297,12 +297,13 @@ func ReadGrpcServerConfig(cfg *setting.Cfg) *grpcutils.AuthenticatorConfig {
func NewAuthenticatorWithFallback(cfg *setting.Cfg, reg prometheus.Registerer, tracer trace.Tracer, fallback func(context.Context) (context.Context, error)) func(context.Context) (context.Context, error) {
authCfg := ReadGrpcServerConfig(cfg)
authenticator := grpcutils.NewAuthenticator(authCfg, tracer)
metrics := newMetrics(reg)
return func(ctx context.Context) (context.Context, error) {
a := &authenticatorWithFallback{
authenticator: authenticator,
fallback: fallback,
tracer: tracer,
metrics: newMetrics(reg),
metrics: metrics,
}
return a.Authenticate(ctx)
}

Loading…
Cancel
Save