Key entitlements by Keycloak user id, not username #81
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
priority
high
priority
low
priority
medium
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-auth-reconciler#81
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "%!s()"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
What
Tier and role sets hold Keycloak usernames and are matched against the Forgejo login. The identity step joins on the user id (
login_name) and renames accounts.Why
The two joins disagree. A rename Forgejo refuses leaves the old login in place while the sets carry the new name.
Failing case
A Keycloak user
aliceis renamedalice2. Forgejo refuses the rename (422, name taken or reserved). The account staysalice. The sets now holdalice2, so a paying user falls back to the zero-quota participant group and loses org-create and Actions. This repeats every run. A local Forgejo account named like a Keycloak user, with an emptylogin_name, would also inherit that user's entitlements.Fix
Return ids with each member from the Keycloak reads. Key the sets by id. Map each Forgejo account by
login_name. Fall back to the normalised login only for accounts with an emptylogin_name(exempt, break-glass).Done when
Plan outline
{id, username}fromgetGroupMembers,getRoleUsersandresolveRoleMembers.listAccounts.classifyUser. Check id first, then the normalised-login fallback for exempt and local accounts.