mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-22 05:49:07 +00:00
refactor(auth): /auth/me returns permissions only (drop roles/modules)
Keep Maestro a pure identity provider: /auth/me exposes the user's permission claim strings and nothing consumer-specific. Consumers derive whatever meaning they need (roles, module access, groups) from the claim vocabulary — claims are already namespaced group:action. - UserDTO: drop roles[]/modules[], keep permissions[]. - Helper shrinks to a generic seqid->claim translation (orchest-identity.ts -> permission-claims.ts, translateSeqidsToClaims). - api-key branch: permissions: [] only. The roles/modules derivation moves entirely to the consumer (Orchest's auth-server adapter). Co-Authored-By: WOZCODE <contact@withwoz.com>
This commit is contained in:
@@ -35,7 +35,7 @@ import { BulkEditResponse, UserDTO } from './dtos/login';
|
||||
import jwt, { JwtPayload } from 'jsonwebtoken';
|
||||
import { PackTheMetadata } from 'src/utils/PackTheMetadata';
|
||||
import { Request, Response } from 'express';
|
||||
import { deriveOrchestIdentity } from './orchest-identity';
|
||||
import { translateSeqidsToClaims } from './permission-claims';
|
||||
|
||||
type AuthSession = {
|
||||
accessToken?: string;
|
||||
@@ -448,7 +448,7 @@ export class AuthClientService implements OnModuleInit {
|
||||
name: payload.customer_name,
|
||||
tier: payload.customer_tier,
|
||||
},
|
||||
...deriveOrchestIdentity(payload.permissions),
|
||||
permissions: translateSeqidsToClaims(payload.permissions),
|
||||
};
|
||||
|
||||
return userDto;
|
||||
|
||||
Reference in New Issue
Block a user