Loading
docs(specs): rewrite S08 for token exchange
Summary
- Problem: S08 (authentication) still describes the bootstrap-token stub as the only way a client authenticates. S34 (development-mode) deleted that stub, and token exchange shipped without a spec describing it. Other specs still call S08 and S09 stubs.
- Impact: Readers of the specs, people and agents alike, get a wrong picture of authentication. Nothing changes for users: the code already behaves as this spec now says.
- Change:
- S08 now specifies the two validators a deployment can run:
- Token exchange: issuer, audiences, RS256, an
httpssigning-key fetch refreshed every 15 minutes with a readiness check, composite-identity rejection, failure reasons and/v2/auth/token. - The development credential, specified in S34.
- Token exchange: issuer, audiences, RS256, an
- S08 follows the current spec template. A Deferred section records one deferral, and a settings table replaces the proto messages, so the spec names no code.
- The other specs that called S08 or S09 a stub now say what shipped:
- S12 (container-oci-hosted)
- S13 (virtual-remote-foundation)
- S14 (maven-remote)
- S15 (npm-remote)
- S16 (container-remote)
- S17 (rest-management-api)
- S23 (usage-data-collection)
- S25 (iam-relationships-client)
- S30 (maven-virtual)
- S31 (npm-virtual)
- S32 (container-virtual)
- S33 (gitlab-api)
- monolith S02 (ar-ruby-client)
- The observability catalog names S08 as owner of the two JWKS metrics.
- The S08 and S09 stub plans are retired. Their steps merged long ago, and S34 deleted what they built.
- S08 now specifies the two validators a deployment can run:
- Downsides: None for behavior. Every heading other specs link to is kept, except the removed "Proto messages" section, which only the retired stub plan linked to.
Checklist
- Gaps:
- Least sure: Whether S08 should state the 15-minute key refresh interval. The token-validation library fixes it, not configuration, so a library update could change it without touching this repository.
- Compatibility: Nothing breaks. This MR changes documentation only and describes what already shipped.
- Agreement: A Staff+ approval for the spec changes. The owner of monolith S02 should agree with its per-user credential wording.
- Simplicity: I considered keeping the proto messages for precision, and rejected it. The configuration reference already lists every field with its type and default, so S08 keeps only a short settings table.
Follow-ups, out of this MR's scope:
internal/auth/tokenexchange/verifier.goand theTokenExchangeConfigcomment inconfig.protocitedocs/specs/S33-authentication-token-exchange.md, which does not exist. Fixing that is a code change.- Some specs still mention the stubs:
- S20-A (lifecycle-closed-beta) line 1045
- S30 (maven-virtual) line 663
- S31 (npm-virtual) line 1768
- S32 (container-virtual) lines 718 and 1273
- The test comment in
internal/usagedata/context_test.gothat says "until S08 lands" is stale. It is Go code, so it is left for a code MR. - S23 and S25 still name Go packages and functions throughout, which predates the rule against code identifiers in specs.
- Code comments and test messages in
internal/authstill cite S08 sections this MR renamed or removed: "Error Cases", "Per-request flow", "Per-prefixWWW-Authenticateheaders" and "Acceptance Criteria". They are inauth.go,middleware.go,dispatch.go,challenge.go,ocierror.goand their tests. S33 (gitlab-api) line 348 still says "the S08 interim". - Four places still say the token library knows only two audiences; it knows five, as S08 now says:
docs/dev/configuration-reference.mdline 146, theTokenExchangeConfigcomment inconfig.proto(regeneratinggen/), and the comments inconfig.example.yamlandtest/caproni/values/artifact-registry.yaml.
Related to #692 (closed)
Edited by David Fernandez