Repository navigation
Description
Problem: "Bind provider-identity rows to the issuer and subject claim that created them" (#7256, PR #7347) stamps each provider-identity row with the issuer and subject claim used at sign-in, and refuses or replaces a row stamped under a different binding. Rows from before that change have no stamp. The sign-in path stamps them the next time the user signs in, but the ID-JAG subject resolver reads them without stamping. So a user who stays away through an upstream repoint keeps an unstamped row, and anyone at the new identity provider with the same subject value can match it. This is not limited to the first repoint: any dormant user's row stays claimable on every later repoint until that user signs in again.
The risk is narrow. It needs an in-place repoint of an existing upstream name, a user who stays away for the whole window, and a matching subject value at the new identity provider. "Bind provider-identity rows to the issuer and subject claim that created them" documents the window and tells operators to run the upgrade and any repoint as separate rollouts with a full sign-in cycle between them. Docs are all that closes it today.
Proposed approach: store one binding record per upstream name (issuer and subject claim), written set-if-absent the first time a build that knows about bindings starts. Compare it with the configured binding at startup and fail with a clear message on mismatch (for example "flush the store or rename the upstream"). That closes the dormant-row window for every repoint, without depending on each row being stamped. Whether it replaces the per-row stamp or sits next to it is part of this issue.
Things to decide:
- Replace the per-row stamp and its compare-and-swap, or keep both. The record gives up automatic replace-on-mismatch in exchange for an operator action at repoint time.
- Where the record lives for each backend (memory, Redis) and how embedders that wrap storage reach it. Embedders that serve identity rows themselves, for example by looking each one up in a directory, build rows on the fly and must not be forced to write one.
- What a rolling restart does when old and new pods share Redis while the config changes.
- How this fits with the cross-issuer mapping in "Delegated access: tokens and actors from third-party issuers" (Delegated access: tokens and actors from third-party issuers #7159), which compares tokens from a different issuer against the sign-in binding.
Acceptance:
- A repoint of an upstream whose users all have unstamped rows is refused at startup, or its rows are not claimable by the new identity provider.
- A first start on a store with existing unstamped rows records the binding once and does not change behaviour for current users.
- Contract tests run against the memory and Redis backends.
- The migration section of
docs/arch/11-auth-server-storage.mddescribes the new behaviour and drops the separate-rollouts workaround if it is no longer needed.
Depends on: "Bind provider-identity rows to the issuer and subject claim that created them" (#7256).
Activity