K8s: namespace mapper should use authlib's util (#92332)
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
authnlib "github.com/grafana/authlib/authn"
|
||||
authzlib "github.com/grafana/authlib/authz"
|
||||
authzv1 "github.com/grafana/authlib/authz/proto/v1"
|
||||
"github.com/grafana/authlib/claims"
|
||||
grpcAuth "github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/auth"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
@@ -105,7 +106,7 @@ func newInProcLegacyClient(server *legacyServer) (authzlib.MultiTenantClient, er
|
||||
&authzlib.MultiTenantClientConfig{},
|
||||
authzlib.WithGrpcConnectionLCOption(channel),
|
||||
// nolint:staticcheck
|
||||
authzlib.WithNamespaceFormatterLCOption(authnlib.OnPremNamespaceFormatter),
|
||||
authzlib.WithNamespaceFormatterLCOption(claims.OrgNamespaceFormatter),
|
||||
authzlib.WithDisableAccessTokenLCOption(),
|
||||
)
|
||||
}
|
||||
@@ -129,7 +130,7 @@ func newGrpcLegacyClient(address string) (authzlib.MultiTenantClient, error) {
|
||||
grpc.WithStreamInterceptor(clientInterceptor.StreamClientInterceptor),
|
||||
),
|
||||
// nolint:staticcheck
|
||||
authzlib.WithNamespaceFormatterLCOption(authnlib.OnPremNamespaceFormatter),
|
||||
authzlib.WithNamespaceFormatterLCOption(claims.OrgNamespaceFormatter),
|
||||
// TODO(drclau): remove this once we have access token support on-prem
|
||||
authzlib.WithDisableAccessTokenLCOption(),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user