Document the users, groups and roles model in README
CI / full-gate (push) Successful in 2m35s

This commit is contained in:
2026-08-03 11:39:26 +02:00
parent acce2d2556
commit ca3d49ec45
8 changed files with 195 additions and 72 deletions
+2 -2
View File
@@ -32,9 +32,9 @@ export function roleTuple(identityId: string, role: string) {
// unioned with every discovered plugin's declared role names (a route/nav `role` is a
// coarse role — granted as a Keto `Role:<token>#members` tuple). So the host names no plugin, yet a
// dropped-in plugin's tokens are seeded out of the box. Deduped, order-stable, blanks dropped.
export function seedRoles(adminRolesEnv: string | undefined, declaredTokens: string[]): string[] {
export function seedRoles(adminRolesEnv: string | undefined, declaredRoles: string[]): string[] {
const clean = (xs: string[]): string[] => xs.map((r) => r.trim()).filter(Boolean);
return [...new Set([...clean((adminRolesEnv ?? "admin").split(",")), ...clean(declaredTokens)])];
return [...new Set([...clean((adminRolesEnv ?? "admin").split(",")), ...clean(declaredRoles)])];
}
// --- JWKS safety net -----------------------------------------------------------------