Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
refactor: acl interceptor (#12890)
Danny Xu80ae3d7b49f3
diff --git a/backend/api/v1/acl.go b/backend/api/v1/acl.goindex 59f828b697..89be4987d8 100644--- a/backend/api/v1/acl.go+++ b/backend/api/v1/acl.go@@ -56,7 +56,7 @@ func (in *ACLInterceptor) ACLInterceptor(ctx context.Context, request any, servereturn nil, status.Errorf(codes.Unauthenticated, "unauthenticated for method %q", serverInfo.FullMethod)}- if err := in.aclInterceptorDo(ctx, serverInfo.FullMethod, request, user); err != nil {+ if err := in.checkIAMPermission(ctx, serverInfo.FullMethod, request, user); err != nil {return nil, err}@@ -89,7 +89,7 @@ func (in *ACLInterceptor) ACLStreamInterceptor(request any, ss grpc.ServerStreamreturn status.Errorf(codes.Unauthenticated, "unauthenticated for method %q", serverInfo.FullMethod)}- if err := in.aclInterceptorDo(ctx, serverInfo.FullMethod, request, user); err != nil {+ if err := in.checkIAMPermission(ctx, serverInfo.FullMethod, request, user); err != nil {return err}@@ -105,10 +105,6 @@ func (s overrideStream) Context() context.Context {return s.childCtx}-func (in *ACLInterceptor) aclInterceptorDo(ctx context.Context, fullMethod string, request any, user *store.UserMessage) error {- return in.checkIAMPermission(ctx, fullMethod, request, user)-}-func (in *ACLInterceptor) getUser(ctx context.Context) (*store.UserMessage, error) {principalPtr := ctx.Value(common.PrincipalIDContextKey)if principalPtr == nil {