Rename the coarse gate from role to permission, matching RBAC
This commit is contained in:
@@ -41,7 +41,7 @@ selfservice:
|
||||
ui_url: http://localhost:3000/login
|
||||
after:
|
||||
# After authenticating, land on our completion route — it mints the session JWT
|
||||
# (roles from Keto → metadata_public projection → tokenize) and sets our cookie.
|
||||
# (permissions from Keto → metadata_public projection → tokenize) and sets our cookie.
|
||||
default_browser_return_url: http://localhost:3000/auth/complete
|
||||
registration:
|
||||
ui_url: http://localhost:3000/registration
|
||||
@@ -94,7 +94,7 @@ session:
|
||||
same_site: Lax
|
||||
# Session→JWT tokenizer: whoami(tokenize_as: plainpages) mints a short-lived,
|
||||
# locally-verifiable JWT so the hot path never calls Ory. Claims come from the
|
||||
# committed Jsonnet mapper (sub = identity id, email from traits, roles from the
|
||||
# committed Jsonnet mapper (sub = identity id, email from traits, permissions from the
|
||||
# metadata_public projection); signed with tokenizer/jwks.json.
|
||||
whoami:
|
||||
tokenizer:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Session→JWT claims mapper for the `plainpages` tokenizer. Kratos exposes the
|
||||
// session as `session`; `sub` is set from the identity id (subject_source: id) and
|
||||
// can't be overridden here. roles come from metadata_public — the per-login projection
|
||||
// of Keto roles the app refreshes at login (metadata_admin is NOT carried in the session
|
||||
// can't be overridden here. permissions come from metadata_public — the per-login projection
|
||||
// of Keto permissions the app refreshes at login (metadata_admin is NOT carried in the session
|
||||
// the tokenizer sees; metadata_public is). Absent on a fresh identity ⇒ empty list.
|
||||
local session = std.extVar('session');
|
||||
local meta =
|
||||
@@ -12,6 +12,6 @@ local meta =
|
||||
{
|
||||
claims: {
|
||||
email: session.identity.traits.email,
|
||||
roles: if std.objectHas(meta, 'roles') then meta.roles else [],
|
||||
permissions: if std.objectHas(meta, 'permissions') then meta.permissions else [],
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user