fix: move keycloak group client-role assignments to 05-group-roles.yaml - #56
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the production Keycloak config-cli ConfigMap for j26-keycloak-scoutid to match the regenerated upstream configuration, addressing a username validation failure for Scoutnet-style usernames and making group→client-role imports deterministic on fresh realm bootstrap.
Changes:
- Removes the
up-username-not-idn-homographusername validator soscoutnet|<id>usernames no longer fail validation. - Moves group→client-role assignments out of
01-realm.yamlinto a new05-group-roles.yamlso they import after04-clients.yaml(roles exist before assignment). - Adds/updates inline comments documenting the import-order dependency and managed-group behavior assumptions.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Just double checking. Have you verified that it's |
|
You were right to be unsure — I tested it, and my diagnosis was wrong. The username validator is not the cause, so I'm dropping that half of this PR. The testThe The pipe does not trip that validator. (Test user deleted afterwards.) The real user I had inferred the mechanism from the config — pipe + a homograph/mixed-script guard sounded like a match — instead of reproducing it. That was my mistake, and removing the validator would have been a prod auth change made on a wrong hypothesis. What's still unknownThe actual cause of What I'm doing with this PRSplitting it: keeping the Pushing the reduced version to this branch shortly. |
Regenerated from the j26-keycloak source repo (f8098ae). config-cli imports files alphabetically, and a group's clientRoles assignment needs the referenced client role to already exist. Those roles are defined in 04-clients.yaml, so keeping the assignments in 01-realm.yaml (imported 2nd) fails a fresh-realm import with role-not-found. 05-group-roles.yaml imports after 04; the group structure stays in 01-realm.yaml. Verified live in j26-prod: config-cli imports clean (00-05), both role assignments applied, sync-owned group subtree untouched (857 groups / 577 kår / 242 villages before and after). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0c4f3f5 to
6726694
Compare
Copies the regenerated
45-keycloak-config-configmap.yamlfrom thej26-keycloaksource repo (commitf8098ae) into the prod manifests.Move group→client-role assignments to
05-group-roles.yamlconfig-cli imports files alphabetically. A group’s
clientRolesassignment needs the referenced client role to already exist — those roles are defined in04-clients.yaml, so the assignments must run after it. Keeping them in01-realm.yaml(imported 2nd) works in steady state but fails a fresh-realm rebuild with role-not-found. The new05-group-roles.yamlimports last; the group structure stays in01-realm.yaml.Verified live in j26-prod
Applied manually via
kubectland tested before this PR:j26-scoutid-sync → j26-booking:bookings:self:create,planning-staff → j26-signupinfo:summaries:read.05group re-declaration +IMPORT_MANAGED_GROUP=no-deletedid not prune.Scope note — username validator removal dropped
This PR previously also removed the
up-username-not-idn-homographusername validator, on the theory that the pipe inscoutnet|<id>tripped it. That was wrong — tested and disproved: with the validator active,kcadmcreatedscoutnet|999999-zz-claudetestwithout error. That change has been reverted in the source repo and dropped here, so this PR is now only the ordering fix and does not touch the validator.The real cause of
error-username-invalid-characteronuser:3222778is still unidentified. It’s currently dormant — the validator only runs when Keycloak writes a user profile, and the syncs are clean withUsers created: 0.Note on urgency
The fix is applied live but not durable:
j26-keycloak-scoutid-prodhasautomated: true, so any commit landing onmain(even unrelated) triggers an auto-sync that re-applies main’s configmap and wipes it. This already happened once. Merging this is what makes it stick.🤖 Generated with Claude Code