Repository navigation
refactor(auth): route OAuth operation locks through one provider table (ENG-1066) - #345
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
b474a82 to
8077e32
Compare
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…e (ENG-1066) Slice AP2. CredentialStore kept a process mutex and CredentialPaths a lock file per OAuth provider, and set/remove probed each provider's lock by name prefix in turn. An OAuthProvider table now owns the name, lock file name and lock-unavailable error; one lock_oauth_operation serves logins, refreshes, rotations and removals. Lock file names and acquisition order are unchanged (a credential name matches at most one provider). The public codex_lock_file/xai_lock_file accessors are replaced by a crate-private oauth_lock_file; nothing outside qq-auth used them.
…NG-1066) Slice AP2 acceptance. Pin the openai-codex.lock and xai.lock names that concurrently running QQ versions share, the credential-name prefix match, and that a second store's rotation of an xAI credential waits for a refresh in progress. Removing the operation lock from set_with_metadata fails the second test.
8077e32 to
4d201f3
Compare
AP2: route OAuth operation locks through one provider table
Spec: docs/plans/auth-providers.md (AP2) Linear: ENG-1066 Stacked on: #343
Behaviour-preserving refactor. No user-visible change.
What changed
oauth::OAuthProvider(OpenAI Codex, xAI) owns each provider's credential-name prefix, lock file name and lock-unavailable error.CredentialStorereplaces itscodex_refresh/xai_refreshmutexes with one per-provider array.CredentialPathsreplacescodex_lock_file/xai_lock_filewith a per-provider array. Onelock_oauth_operationserves login, refresh, rotation and removal.setandremovelook up the owning provider instead of trying each prefix in turn, and the refresh paths no longer.expect()on a prefix match.openai-codex.lock,xai.lock) and acquisition order are unchanged: a credential name matches at most one provider.CredentialPaths::{codex_lock_file, xai_lock_file}accessors become a crate-privateoauth_lock_file(provider). Nothing outsideqq-authused them.How verified
cargo xtask check
Head
f79dfb12514dvsorigin/main; 9 changed file(s); scope: qq, qq-auth, qq-harness, xtask.cargo fmt --all -- --checkcargo xtask lintcargo clippy --color never -p qq -p qq-auth -p qq-harness -p xtask --all-targets --all-features -- -D warningscargo nextest run --color never --profile default -p qq -p qq-auth -p qq-harness -p xtaskAll gates passed in 45.2s.
cargo nextest run -p qq-auth: 77/77 before; 79/79 after. Existing tests are unchanged apart from the renamed lock-path accessor.oauth_operations_lock_the_published_per_provider_filespins both lock file names and the prefix match.an_xai_refresh_holds_xai_lock_against_a_second_store_rotationshows that a refreshing store holdsxai.lock(and not the Codex lock), and that a second store'ssetwaits for it. With the lock removed fromset_with_metadata, this test fails ("a second store rotated an xAI credential during its refresh"). It passed 20/20 locally.cargo xtask smoke: 6/6.xtask perf::tests::busy_workspace_fixture_seeds_a_long_history(run completion). The host was under load from another workload at the time. The test passed 3/3 in isolation and the gate passed on rerun. This PR doesn't touch xtask.Compatibility