Skip to content

Move the authorization server's multi-issuer validator onto authn #7470

Backlog

Description

@jhrozek

The first PR, the pinning tests, can start now. The rest waits on #7471, the SPIFFE delegation work, and
toolhive-core.

Why. The authorization server's own key fetching and issuer routing duplicate authn, and its acceptance rules
keep growing: grant profiles, Workload Authorization Grants, claim bindings. With authn's immutable TrustSet,
built anew and swapped, trusted issuers can also change at runtime. It also removes three copies of the audience
check.

What, in this order:

  1. Pinning tests, through the real handlers, asserting the wire answer (error code, reason, hint) for JWT-bearer
    assertions, ID-JAG and WAG redemption, and token-exchange subject tokens:
    • typ handling, including every spelling of the grant types;
    • missing exp, iat or sub; single and multiple audiences; a wrong issuer; leeway edges;
    • a resource that must equal an allowed audience; a multi-valued aud on grants;
    • delegated-access marker tokens and tokens carrying authorization_details, both refused as input;
    • issuer assertion types and claim bindings; the actor check at redemption; subject resolution;
    • the grant profiles advertised in discovery.
  2. The rebuild. Each external issuer becomes a trust, and rules are chosen by grant profile. The
    authorization-server policy stays: actor consent, delegate clients, assertion age and subject binding, replay,
    and iss#sub qualification. Today's behaviour that authn lacks needs a core option or a release note.
  3. Runtime trusted issuers. An API that lets a host program replace the trusted issuers by building a new set and
    swapping it, through authserver: export the RunConfig→Config construction so embedders can use authserver.New without reimplementing it #5773 (let host programs build the auth server config without copying code).

Done when. The pinning tests pass after the rebuild, except rows changed on purpose with a release note. A host
program can change trusted issuers without a restart.

Blocked by (the rebuild):

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions