Skip to content

Delegated access: resolve the ID-JAG subject and issue the marked token behind the gate #7246

Done

Description

@jhrozek

Part of "Delegated access: subject mapping at ID-JAG redemption" (#6887).

Branch: as2-subject-mapping-3-resolution (about 250 lines). Phase: 1.

Problem. Redemption never resolves the ID-JAG's upstream_subject to a local user and never issues the marker that lets the gateway read that user's connections.

Change (resolve issuers):

  • Build the resolver from AS-2's sign-in upstream (in server_impl): its issuer and its subject claim are the only accepted values. The resolver lives on the ID-JAG handler, passed through the ID-JAG issuance factory as a FactoryOption (the call-binding work adds its details registry and client lifespans the same way); never on the shared handler-dependencies struct, which would give the handlers the unfiltered issuer list.
  • Parse upstream_subject ({iss, claim, value}). A missing or malformed claim, an issuer other than the sign-in upstream's, or a different claim is refused as invalid_grant, invalid_assertion.
  • Call the resolver. Unknown, ambiguous or empty is access_denied with subject_unknown. Resolver unavailable is server_error, with nothing consumed.
  • Issue sub = the local user, act copied, no_upstream_session, no tsid, no refresh token, and the marker, with the lifetime capped at five minutes.
  • The code gate from "Delegated access: subject mapping setting and code gate for ID-JAG issuers" still refuses everything, so none of this is reachable yet.

Acceptance. Resolver cases (found, unknown, ambiguous, unavailable, empty with nil error). The marker is present on every resolved token. The lifetime is the minimum of the client's lifespan if set (else the server's access-token lifespan), the ID-JAG's remaining validity, and five minutes for a marked token. The marker cap wins even over a longer client lifespan. (The per-client lifespan comes with the call-binding work and is not on main; both specs state this one rule.) A synthetic subject never resolves. An empty resolved user is refused before the jti is consumed. Tests call the resolution step and the redeemer's session and lifetime directly, because over HTTP the gate refuses first. docs/arch/17 describes subject modes, the check order, the marker, and what AS-1 must send (required_subject_claims includes upstream_subject; its actor issuer is listed in actor_issuers; its ID-JAG lifetime outlasts the redemption).

Depends on. "Delegated access: actor checks at ID-JAG redemption", and a real dependency on tokenexchange-refactor-3-redeemer: the resolved subject on the redemption, the marker stamped when the token is completed, and the cap in the lifetime step all live in the redeemer.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions