feat(keycloak): add techgarden admin realm role and pin iris-web scopes#263
Merged
Merged
Conversation
Adds the first custom role to the dev techgarden realm so the API can gate its feedback triage inbox on ROLE_ADMIN, assigns it to kian, and pins iris-web's defaultClientScopes so realm_access.roles reliably reaches the access token.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the first custom role to the dev
techgardenrealm. TechGarden's API is gaining its first authorization tier, and Keycloak is the role store.What changed
Three additive edits to
kubernetes/clusters/1276-dev/keycloak/keycloak/base/realms/techgarden-realm.json:rolesblock declaring realm roleadmin. The realm previously had noroleskey at all. Shape matches the sibling realms (hausparty-realm.json,accounts-realm.json)."realmRoles": ["admin"]on thekianuser. The other users stay deliberately non-admin so they remain useful as non-privileged test personas.keycloak-config-climatches users byusername(onlyidis ignored on import), so this binds correctly even though user ids are unpinned here.defaultClientScopesoniris-web—["web-origins", "acr", "roles", "profile", "basic", "email"], copied from the workingkian-coffee-webprecedent.Why it enables the feature
The API gates its feedback triage inbox on
ROLE_ADMIN, which Spring derives fromrealm_access.rolesin the access token.realm_access.rolesonly lands in the token if the client has therolesclient scope.iris-webpreviously omitteddefaultClientScopesentirely, so it got that scope only via Keycloak's implicit realm defaults — working, but unpinned and invisible.Pinning it explicitly also closes a latent trap: the
accountsandhauspartyclients in this same directory use["basic", "profile", "email"], which omitsroles. A future copy-paste of that shape ontoiris-webwould silently striprealm_access.rolesfrom every token and break admin gating with no config error to point at. The list is now explicit and self-documenting.Safety
techgardenrealm (1276-prod/.../realms/holds onlyaccounts,hausparty,kian-coffee), and nothing under1276-prodis touched.keycloak-config-clias an ArgoCD PostSync hook with everyIMPORT_MANAGED_*flag set tono-delete— includingIMPORT_MANAGED_ROLE— so this cannot prune existing roles, clients, users, or scopes.accessTokenLifespan,revokeRefreshToken,refreshTokenMaxReuse, anyssoSession*/offlineSession*value, orrememberMe— those are tuned for iOS PWA session survival. Verified by assertion, not by eye.python3 -m json.tool); diff is 21 insertions across exactly the three additions, with no reordering or reformatting of untouched lines.🤖 Generated with Claude Code