Read identities and entitlements from Keycloak #78

Stängd
öppnade 2026-10-08 14:52:47 +00:00 av supernaut · 2 kommentarer
Ägare

Replace the Kanidm reader with a Keycloak admin REST client.

  • Replace src/kanidm-http.ts and src/kanidm-client.ts. Client-credentials token for bitborg-reconciler.
  • Read users (id, username, display name, email), group members, realm roles with user and group mappings.
  • Expand entitlements from groups and role mappings as src/members.ts does today.
  • Keep fail-closed on any read error and the refusal when all tiers are empty.
  • Join key unchanged: Forgejo login_name equals the user id.
  • Env KEYCLOAK_URL, KEYCLOAK_REALM, KEYCLOAK_CLIENT_ID, KEYCLOAK_CLIENT_SECRET replace KANIDM_*.
  • Unit tests with fixtures in the new shape. Release a tag. Infra pins it at cutover.

Done when: tests pass and a dry-run on staging reports no changes for imported users.

Depends on: bitborg/bitborg-infra#571
Epic: bitborg/bitborg-docs#127

Replace the Kanidm reader with a Keycloak admin REST client. - [ ] Replace `src/kanidm-http.ts` and `src/kanidm-client.ts`. Client-credentials token for `bitborg-reconciler`. - [ ] Read users (id, username, display name, email), group members, realm roles with user and group mappings. - [ ] Expand entitlements from groups and role mappings as `src/members.ts` does today. - [ ] Keep fail-closed on any read error and the refusal when all tiers are empty. - [ ] Join key unchanged: Forgejo `login_name` equals the user id. - [ ] Env `KEYCLOAK_URL`, `KEYCLOAK_REALM`, `KEYCLOAK_CLIENT_ID`, `KEYCLOAK_CLIENT_SECRET` replace `KANIDM_*`. - [ ] Unit tests with fixtures in the new shape. Release a tag. Infra pins it at cutover. Done when: tests pass and a dry-run on staging reports no changes for imported users. Depends on: bitborg/bitborg-infra#571 Epic: bitborg/bitborg-docs#127
supernaut refererade till detta ärende från en incheckning 2026-10-08 20:15:11 +00:00
Upphovsperson
Ägare

Released as v2.0.0 (#79).

Staging dry run against the applied realm passed, with seeded users rather than an import:

  • The join on the Keycloak user id worked. A seeded user with the id of a staging Forgejo login_name matched its account.
  • tier_pro gave quota=paid and actions=true through ent_runners_shared.
  • An account with no tier signal failed closed to participant.
  • The bitborg-reconciler client read users, groups and roles.

Still open: the done-when check. A dry run after importing the real staging users with the migration tooling must report no changes.

Released as v2.0.0 (#79). Staging dry run against the applied realm passed, with seeded users rather than an import: - The join on the Keycloak user id worked. A seeded user with the id of a staging Forgejo `login_name` matched its account. - `tier_pro` gave `quota=paid` and `actions=true` through `ent_runners_shared`. - An account with no tier signal failed closed to `participant`. - The `bitborg-reconciler` client read users, groups and roles. Still open: the done-when check. A dry run after importing the real staging users with the migration tooling must report no changes.
Upphovsperson
Ägare

Staging dry run, 2026-10-09: done-when met.

  • v2.0.0 image, RECONCILE_APPLY=false, against staging Keycloak with a migrated copy of the production identities and a restored copy of the production Forgejo database, both wiped the same day.
  • Every account resolves to the same quota group and Actions and Renovate state as today. No account fails closed.
  • The dry-run log prints its "would ensure" lines on every run. Each one was checked against the restored database and is already in place, so the run makes no effective change.
  • Tests: 150/150.

Follow-up worth having: a dry run that prints only real differences.

Staging dry run, 2026-10-09: done-when met. - `v2.0.0` image, `RECONCILE_APPLY=false`, against staging Keycloak with a migrated copy of the production identities and a restored copy of the production Forgejo database, both wiped the same day. - Every account resolves to the same quota group and Actions and Renovate state as today. No account fails closed. - The dry-run log prints its "would ensure" lines on every run. Each one was checked against the restored database and is already in place, so the run makes no effective change. - Tests: 150/150. Follow-up worth having: a dry run that prints only real differences.
Logga in för att delta i denna konversation.
Ingen milstolpe
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-auth-reconciler#78
Ingen beskrivning angiven.