Skip to content

fix: sync prod keycloak realm with dev (cms/reports clients + admin groups) - #73

Merged
hakan-persson merged 2 commits into
mainfrom
fix/keycloak-sync-prod-realm
Jul 25, 2026
Merged

fix: sync prod keycloak realm with dev (cms/reports clients + admin groups)#73
hakan-persson merged 2 commits into
mainfrom
fix/keycloak-sync-prod-realm

Conversation

@hakan-persson

Copy link
Copy Markdown
Member

Copies the regenerated 45-keycloak-config-configmap.yaml from the j26-keycloak source repo (commit bd0ffbe) into the prod manifests. Brings the prod realm in line with dev (id.dev.j26.se). Additions only — no removals.

What it adds

  • 2 role-container clientsj26-cms, j26-reports (JWT-verify only, no secret/flows, like j26-signupinfo).
  • Client rolesj26-cms: editor, admin; j26-reports: diet:read.
  • 4 hand-managed admin groupsj26-checkin-admin, j26-cms-manager, j26-platsbank-admin, j26-reports (top-level siblings of j26-scoutid-sync, not sync-owned).
  • Expanded group→client-role assignments in 05-group-roles.yaml — staff/planning-staff/leader gain booking + platsbank (+ signupinfo) roles; the admin groups carry elevated roles.

Tested in j26-prod

Verified against a fresh config-cli import (run via an unmanaged test ConfigMap — a manual apply of the live one is auto-reverted by ArgoCD, since j26-keycloak-scoutid-prod has automated: true):

  • Imports clean 00→05, no errors.
  • Both new clients + all 4 admin groups created; role assignments attach (e.g. j26-cms-manager → j26-cms: editor, admin).
  • Sync-owned group subtree untouched — kår 577 / villages 242 / districts 5 (the 05 group re-declaration + IMPORT_MANAGED_GROUP=no-delete did not prune).
  • Auth works (token issuance OK).

Because of automated: true, prod picks this up only when this merges — there is no manual live bridge this time.

🤖 Generated with Claude Code

…roups)

Regenerated from the j26-keycloak source repo (bd0ffbe). Additions only,
no removals:
- New role-container clients j26-cms and j26-reports (JWT-verify only, no
  secret/flows) + their client roles (cms: editor/admin, reports: diet:read).
- Four hand-managed admin groups (j26-checkin-admin, j26-cms-manager,
  j26-platsbank-admin, j26-reports), top-level siblings of j26-scoutid-sync.
- Expanded group->client-role assignments in 05-group-roles.yaml
  (staff/planning-staff/leader booking+platsbank roles; admin groups).

Tested against a fresh config-cli import in j26-prod (via an unmanaged test
ConfigMap, since ArgoCD auto-reverts a manual apply of the live one): imports
clean 00-05, both new clients + all 4 admin groups created, role assignments
attach, and the sync-owned subtree is untouched (kår 577 / villages 242 /
districts 5). Auth works.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 22, 2026 14:20
@hakan-persson
hakan-persson requested a review from a team as a code owner July 22, 2026 14:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the production Keycloak realm configuration ConfigMap for j26-keycloak-scoutid to match the regenerated dev-aligned export (from j26-keycloak commit bd0ffbe), adding new role-container clients, roles, and hand-managed admin groups intended for production use.

Changes:

  • Added standalone (non-sync-owned) admin groups (j26-checkin-admin, j26-cms-manager, j26-platsbank-admin, j26-reports) to the declared group structure and role-assignment declarations.
  • Added role-container clients j26-cms and j26-reports, plus their corresponding client roles.
  • Expanded group → client-role assignments for existing synced groups (staff/planning-staff/leader) to include booking/platsbank roles.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Address Copilot on #73: the comment said 01-realm.yaml declares ONLY the
/j26-scoutid-sync parent group, but this PR also adds the standalone admin
groups there. Reworded to cover both, so the no-delete pruning rationale
stays accurate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@hakan-persson
hakan-persson requested review from Anna-Qvil, m4reko and scriptcoded and removed request for Anna-Qvil, m4reko and scriptcoded July 22, 2026 14:48
@hakan-persson
hakan-persson merged commit 206e32d into main Jul 25, 2026
1 check passed
@hakan-persson
hakan-persson deleted the fix/keycloak-sync-prod-realm branch July 25, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants