Repository navigation
refactor(auth): extract shared provider auth helpers (C1-C7) - #1433
Merged
TheGreatAxios merged 3 commits intoOct 15, 2026
Merged
TheGreatAxios merged 3 commits into
TheGreatAxios merged 3 commits into
Conversation
~250 lines of near-identical callback/login/session/store/lock twins across codex and xai collapse onto seven shared helpers, each taking a small provider spec of explicit hooks. Deliberate provider differences stay hooks, not knobs: the codex inter-process refresh lock is a serializeRefresh hook (xai has none by design), accountId merge and token expiry stay per-provider, the divergent stale horizons carry must-not-unify comments, and exact-code vs substring error matching is untouched. Lock contention still never surfaces as credential_failure. One deliberate delta: the unified file lock propagates non-ENOENT fs errors where the codex refresh lock used to swallow every fs error; the store contract was the stronger one. The propagation is pinned at both levels — this suite exercises the refresh path and file-lock.test pins the primitive.
Contributor
|
Superseded by the comment below. |
Contributor
|
Superseded by the comment below. |
Contributor
|
Triage: Pass No changes needed from you. A maintainer will review this pull request. |
TheGreatAxios
changed the base branch from
cl-10659-providerauth-pins-codex-provider-oauth-core-ws-remov
to
main
October 15, 2026 20:59
…-shared-callbackloginsessionstorelock-h
The shared lock and session helpers stay. Remove the second copy of cases already pinned by the store and refresh-lock suites, unused file-lock exports, and comments that only restated the extraction.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/auth/: callback-server skeleton, login-flow skeleton, token-session lifecycle (session cache + refresh-basis CAS), auth-store definitions, bearer-header builders, scope-check probe, and a unified file lock. Provider files become thin named entry points; every blocker invariant from the ticket stays a hook, not a knob — the codex inter-process refresh lock is aserializeRefresh?hook (xai intentionally lock-free),accountIdmerge and token expiry stay per-provider, the divergent stale horizons (5s store vs 120s refresh) carry must-not-unify comments, and exact-code vs substring error matching is untouched. Lock contention still never surfaces ascredential_failure.file-lock.test.tspins the primitive,refresh-lock.test.tspins the refresh path.sanitizedRefreshFailureflows through both shared refresh paths; redaction/provenance untouched; sorted diff on the token wire contract (TokenSessionshape) shows line-for-line equivalence.Verification
bun run checkexit 0: 8955 pass / 0 fail across 581 files (twice).node_modules/@corbits/oauth-coretypings.Fixes CL-10665