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 https signing-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.
    • 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.
  • 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:
    • The token endpoint reports a fixed expires_in that does not match the token's real lifetime. This is tracked in #1257
    • Public reads are tracked in #1180
    • Organization scoping for Kubernetes peers is in S08's Deferred section, with its trigger.
  • 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.go and the TokenExchangeConfig comment in config.proto cite docs/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.go that 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/auth still cite S08 sections this MR renamed or removed: "Error Cases", "Per-request flow", "Per-prefix WWW-Authenticate headers" and "Acceptance Criteria". They are in auth.go, middleware.go, dispatch.go, challenge.go, ocierror.go and 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.md line 146, the TokenExchangeConfig comment in config.proto (regenerating gen/), and the comments in config.example.yaml and test/caproni/values/artifact-registry.yaml.

Related to #692 (closed)

Edited by David Fernandez

Merge request reports

Loading
Loading