feat(kanidm): enforce the OAuth2 scope-map drift gate #282
Inga granskare
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
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-infra!282
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "feat/275-enforce-drift-gate"
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?
Part of #275. Flips
kanidm_oauth2_drift_failtotrue, plus two cleanups.Enforcement
The gate shipped in warn mode (#281) because the
bitborg-web-devleftover was still live, and a hard gate would have aborted every unrelated apply until someone randelete-scope-mapby hand. That leftover was removed today and all four declared clients now match live exactly.Verified:
--check --tags kanidmexits 0 withchanged=0, and the gate reports drift on none of the four. So an additive scope-map leak now stops the play instead of scrolling past.Fixes a readability defect I introduced
The drift read carries the reconciler token in a header, so it needs
no_log— andno_logcensors per-item loop labels, so the output was four lines ofitem=(censored due to no_log).Rather than drop
no_log(which would print the Authorization header on-vor on failure), a debug now names the client set and the enforcement state up front:Keeping the token unlogged beats prettier output.
Records why claim maps get no gate — verified, not assumed
#281 listed claim-map drift as "not covered". Today's #280 apply answered it:
Claim maps are authoritative. The apply removed the stale
entitlements:ent_lfsandentitlements:ent_lfs_largegroup entries from theforgejoclient purely by declaring the six current groups — even thoughremoveOrphanedClaimMapsoperates at claim level andentitlementswas present. I had flagged that as unpredictable in #280 and said it might need manualdelete-claim-map; it converged on its own.So the declaration is self-correcting for claim maps, and a gate there would be dead code. Scope maps need one precisely because they are the additive exception. That asymmetry is now written down next to the gate.
Verification of the whole #275 chain, live
bitborg-webforgejo_usersbitborg-web-devforgejo_adminsonlyforgejoforgejo_usersforgejo_role → admingrafanagrafana_adminsAnd the behavioural check that mattered: a Forgejo OIDC login after the claim-map rewrite kept site-admin — confirmed both via the admin API and by the operator seeing the admin panel.