Skip to content

v1.8.0 R1: narrow refreshed access-token scopes while preserving the refresh grant #451

Backlog

Description

@voidvec

Problem

Refresh requests currently ignore scope narrowing. An access token always inherits the original refresh-token scope, preventing a caller from requesting a less privileged token for one use.

Evidence

libs/oauth2/src/protocol/TokenService.cc assigns storedRt.scope to the new access token and refresh token. Memory and PostgreSQL rotation currently require access-token scope byte equality. The token controller does not forward a refresh scope request. This is the R1 slice of #408 and #417, based on the v1.7.0 release-preparation baseline and dependent on #446.

Suggested fix

Add a separately named scope-aware API while preserving old signatures/defaults. Validate explicit RFC 6749 scope tokens and subsets after authoritative Ready inspection, preserve original refresh-grant bytes, and use the effective scope for access-token claims. Reject duplicate scope parameters before folding them; preserve client authentication and replay-revocation ordering. Share an allocation-free subset predicate in both storage implementations under the original locks.

Acceptance criteria

  • Explicit equal/subset scope succeeds and echoes canonical effective scope; omitted/empty preserves old response shape and scope bytes.
  • Rotated RT scope, expected snapshot, client/family/org bindings, rotation atomicity and checked reuse revocation remain intact.
  • Invalid scope leaves an unused RT reusable; semantic bad scope cannot bypass AlreadyUsed revocation.
  • Raw parser, Domain, real Memory/Postgres rotation, owned PG HTTP and SDK consumer checks cover positive and negative cases.
  • OpenAPI, generated clients and additive API baseline are synchronized using the existing generators.
  • Final-head required CI, sanitizers, SDK and original hard coverage gates pass; no thresholds are weakened.

Out of scope / follow-ups

Resource authorization, offline_access, Token Exchange, JWK changes, migrations, routes, other grant parsers, teardown issue #300, merging or releasing. This child issue does not close #408 or #417. R1 remains draft until the F0 dependency is integrated and its actual final base is revalidated.

Activity

  1. added 3 commits that reference this issue on Dec 5, 2026
    f03b70d
    56990c0
    0d217ec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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