Repository navigation
refactor(auth): split credential state and backends out of lib.rs (ENG-1066) - #347
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. 🎉 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". |
…G-1066) Slice AP4, move only. The on-disk index and plaintext fallback formats and the hardened file operations move to state.rs; the OS keyring and Windows user-protected backends move to backend.rs. Each module imports what it uses instead of sharing lib.rs's imports; the constants each format owns move with it. lib.rs keeps the CredentialStore operations, errors and resolution. No item, value or behaviour changes.
9283a87 to
9811e69
Compare
…350) * docs(plans): mark AP0–AP4 shipped and map qq-auth modules (ENG-1066) The ledger records the merge commits for #341 and #343–#347 with their receipt; the plan's pre-AP1 shape section says what AP1–AP4 removed; the architecture source map lists qq-auth's modules (lib, state, backend, oauth, codex, xai) instead of lib.rs alone. * docs(plans): state exactly what AP1–AP4 consolidated (ENG-1066) Review of c183af0: the plan claimed AP1–AP4 removed the per-provider storage duplication, but token clients, stored formats, request-credential providers and error mappings remain for AP5/AP8. The architecture map assigned operation locks to oauth.rs; lib.rs acquires them and state.rs defines the guard.
AP4: split credential state and backends out of lib.rs
Spec: docs/plans/auth-providers.md (AP4) Linear: ENG-1066 Stacked on: #346
A move-only refactor. No user-visible change.
What changed
state.rs(new): the on-disk index and plaintext fallback formats (CredentialRecord,IndexState,FallbackState) together with the hardened file operations every write goes through: data-directory checks, lock files, bounded reads, permission checks and atomic writes. The format version constants and the temp-file counter move with them.backend.rs(new): the OS keyring and Windows user-protected secret backends, withWINDOWS_PROTECTED_MAGICand itssha2import, which are Windows-only.lib.rs: 2774 lines down to 1904. It keeps theCredentialStoreoperations, errors, resolution and request-credential loading.lib.rs's. Items that moved becamepub(crate), exceptKeyringBackendandKeyringError, which are still re-exported publicly. No bodies changed.tests.rsimportsfs::Filedirectly. It had been gettingFilefromlib.rsthroughuse super::*.How verified
cargo nextest run -p qq-auth: 79/79, the same count as on the AP3 head. No test or assertion changed.cargo clippy -p qq-auth --all-targets --all-features -D warningsis clean, and so is the minimalqq-providerprofile.cargo xtask smoke: 8/8.git patch-idfor this PR's own diff is the same before and after the rebase ontoorigin/maina9bff3ef.qq headless::tests::closing_goal_host_drains_accepted_work_without_admitting_successors(src/headless.rs:4553, added in feat(cli)!: expose durable goals in TUI and headless commands #331) times out after 10s. It also failed 5 out of 5 runs on the plan-only branch, which has no Rust changes relative toorigin/main, and it passes intermittently, so this PR didn't introduce it. Main's own CI ata9bff3efis red too, ongoal_model_audit_late_and_stale_confirmation_cannot_achieve(crates/qq-core/src/sessions/tests/goal_model_audit.rs:444). Both are from the goals stack (ENG-1063/ENG-1064).cargo xtask check
Head
9283a87ff7b8vsorigin/main; 17 changed file(s); scope: qq, qq-auth, qq-client, qq-config, qq-core, qq-harness, qq-mcp, qq-provider, qq-server, qq-tui, xtask.cargo fmt --all -- --checkcargo xtask lintcargo clippy ... --all-targets --all-features -- -D warningscargo nextest run ...qq headless::tests::closing_goal_host_drains_accepted_work_without_admitting_successors: panicked at src/headless.rs:4553:18 (pre-existing on main; see above).Compatibility