Skip to content

feat(oauth2): narrow refreshed access-token scopes without changing the grant - #452

Draft
voidvec wants to merge 2 commits into
feature/v1.8.0-roadmapfrom
feat/v1.8.0-refresh-scope
Draft

voidvec wants to merge 2 commits into
feature/v1.8.0-roadmapfrom
feat/v1.8.0-refresh-scope

Conversation

@voidvec

@voidvec voidvec commented Dec 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

Refresh callers can request a less privileged access token for one use. A valid explicit scope is restricted to the original refresh grant, sorted/deduplicated, and echoed. Omitted or empty scope preserves the original scope bytes and response shape. The rotated refresh token retains its original grant, so a later refresh can request a different original subset.

Preserve the existing C++ API signatures/defaults and add refreshAccessTokenWithScope. Use the effective scope for access-token and scope-dependent ID-token claims. Validate semantics only after authoritative Ready inspection, preserving client/expiry/storage and reuse-revocation ordering. Detect duplicate/invalidly encoded scope parameters from raw query/form input after client authentication. Standard clients use the form body; a single query scope remains a compatibility extension.

Both authoritative repositories share an allocation-free subset predicate under their existing rotation locks. Expected snapshots, refresh-grant bytes, family/client/org bindings, CAS/commit behavior and cache algorithms remain unchanged. Owned PostgreSQL HTTP fixtures submit writes once and verify their exact ownership and committed cleanup.

Dependency and scope

Draft; depends on #446. Target: feature/v1.8.0-roadmap. The business change is one commit based on F0 aa3ea971; its net diff is 33 files. Until F0 is integrated, this PR also displays F0's nine inherited files. Replant onto the actual integration base and rerun final-head validation before Ready. This PR does not merge its dependency or close the full parent work packages.

The detailed design and three bounded contract/derived-file amendments passed separate protocol/security and execution-boundary reviews before implementation. The temporary generation workflow has been removed. The existing documentation generator also synchronizes the six new guide lines into llms-full.txt; its index is unchanged, regeneration is byte-idempotent, and the Chinese mirror gate passes. Actual pinned generators produced C++ OpenAPI JSON and Python/Go/TypeScript clients. The extra Python MFA model change is docstring-only, verified by AST equality; it inherits the shared token-response documentation. Regeneration also refreshes two previously stale JSON version fields from 1.6.0 to the existing project version 1.7.0; project/release versions are unchanged.

Type of change

  • New feature (non-breaking)
  • Breaking change

Checklist

  • Helper/parser, Domain, real Memory/PostgreSQL rotation, owned PG HTTP and SDK consumer tests added.
  • Docs and Chinese mirror updated.
  • Public API baseline updated additively, without --force; the SDK host adds old-member-type/default-call compile checks.
  • Actual OpenAPI/client regeneration verified by run/head, artifact digest and individual file hashes.
  • No new routes, application errors, migrations, dependency upgrades or coverage/timeout relaxations.
  • Complete current-head CI, real PG/main binary/out-of-process endpoints, installed SDK, sanitizers/interop and original hard coverage acceptance.
  • Dependency integrated and final base revalidated before Ready.

Full local suite: unavailable in this small workspace without CMake/Conan; runtime acceptance uses CI. The local C++17/WERROR standalone driver passed all 256 byte boundaries, 10,000 independent set cases and zero predicate allocations, plus raw parser structural/overflow checks. Source architecture, double-move, audit, API/spec, migration, naming and macro checks pass. Native JsonCpp generated formatting is retained exactly.

CHANGELOG consolidation and the v1.8.0 version/release checklist remain in the reviewed final release task; this slice documents the behavior now. No tag, release or deployment is requested.

Validation

Current business head: 0d217ec0576abf90d30215b37ca804e5982c573d. Required results are pending; F0 and generation scratch runs are not substituted for this head. The first business candidate exposed the missing llms-full.txt synchronization; it is corrected here without changing the generator or site workflow. Website is validated by the PR build, with deployment skipped under the original event condition.

CLA is blocked before any job starts by GitHub's public-repository pull_request_target policy (annotation). This is an Actions-policy startup failure, not an unsigned-contributor result. No CLA, repository-policy or branch-protection bypass was attempted.

The prior candidate ran all three Feature combinations: the 13 new unit cases and owned PG HTTP/replay/cleanup flow passed; the sole main-binary failure was the old token-parameter snapshot (8 expected, 9 registered). This head preserves the old eight names, adds scope and its optional/string metadata assertions. It also limits the noexcept test to explicit string_view arguments so the assertion does not include libc++ implicit C-string conversion. These prior results diagnose the corrections and do not substitute for current-head acceptance.

Fixes #451

Addresses #408

Addresses #417

CI checkpoint — 2026-12-05

At head 0d217ec0576abf90d30215b37ca804e5982c573d, Feature Matrix run 47492408412 attempt 2 now reports success for all three configurations. The two initial failures in unchanged PasswordLoginSessionState/AdminUserImport tests did not reproduce on the same-head rerun; initial evidence is retained and no root-cause fix is claimed. Main three-platform CI/SDK, PR and full manual sanitizers, advisory and hard coverage, interop, OpenAPI, client SDK and website workflows also report success. Final artifact-level acceptance consolidation is still pending.

CLA still fails at workflow startup because GitHub restricts pull_request_target by repository policy; this is not an unsigned-user finding. The PR remains Draft pending F0 dependency and final readiness checks. No repository policy, assertions or CI gates were weakened.

Include the exact v1.8.0 integration branch in existing validation events.
Compare OpenAPI against the actual PR base or an explicit manual base.
Observe asynchronous invitation attribution within a bounded read window,
preserving all lifecycle assertions and registration behavior.

Fixes #445

Fixes #447

Addresses #417
@voidvec
voidvec force-pushed the feat/v1.8.0-refresh-scope branch from f03b70d to 56990c0 Compare December 5, 2026 06:43
Preserve the original refresh grant and legacy API while enforcing bounded explicit access scope subsets under the existing rotation locks.

Fixes #451

Addresses #408

Addresses #417
@voidvec
voidvec force-pushed the feat/v1.8.0-refresh-scope branch from 56990c0 to 0d217ec Compare December 5, 2026 07:07

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant