Skip to content

General RFC 9396 support in the authorization server #6909

Open
0 of 6 issues completed
Open

Description

@jhrozek

Problem: scopes are flat strings. They can say "may call tools on the
GitHub server", but not "may act on repository X, read only, for this one
agent run". Agents that work for a user need authority described per instance,
and token exchange needs a way to hand a narrower piece of that authority to the
next hop. RFC 9396 (authorization_details) is the standard way to describe
this, and other authorization servers and resource servers already use it.
Using it lets ToolHive work with them without a private format.

What exists after #6894: a Go-only registry that maps a type to a Grant
hook and the grant types the type applies to. Only the token-exchange grant uses
it. The hook receives all entries of its type plus the request context: client,
actor, requested token type, requested scopes, granted audience and the
validated subject token. The hook only decides; it must not store anything. The
token response echoes what the hook returned.
With no registry, the parameter is ignored. With a registry, the RFC 9396 §5
checks are strict. Details are not put in tokens, not stored, and not
advertised.

That is enough for the Mecatl path, where the details only matter to the
authorization server. It does not yet meet RFC 9396 §9, which says the AS MUST
make granted details available to the resource server.

Separate from #6886. That epic needs only the token-exchange piece (#6894).
Nothing below blocks it, and none of these issues should change how the session
and schedule types behave unless that type opts in.

Sub-issues:

  1. Convey granted authorization_details to resource servers #6910 Convey granted authorization_details to resource servers
  2. Let Cedar policies use authorization_details #6911 Let Cedar policies use authorization_details (after Convey granted authorization_details to resource servers #6910)
  3. Narrow authorization_details on token exchange and refresh #6912 Narrow authorization_details on token exchange and refresh (after Convey granted authorization_details to resource servers #6910; the refresh part after Persist granted authorization_details and carry them through refresh #6913)
  4. Persist granted authorization_details and carry them through refresh #6913 Persist granted authorization_details and carry them through refresh
  5. Accept authorization_details at the authorization endpoint #6914 Accept authorization_details at the authorization endpoint (lower priority)
  6. Advertise authorization_details types in metadata and DCR #6915 Advertise authorization_details types in metadata and DCR
  7. Declarative type definitions in RunConfig and CRDs: not filed; open an issue if someone needs it

Out of scope here: authorization_details on the JWT-bearer grant (ID-JAG
redemption) is covered by #6887.

Sub-issues

Sub-issues

0 of 6 Issues completed
Loading 6 sub-issues

Metadata

Metadata

Assignees

No one assigned

    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