Skip to content

refactor(auth): share OAuth transport and bookkeeping helpers (ENG-1066) - #343

Merged
lg2m merged 2 commits into
docs/eng-1066-auth-provider-planfrom
refactor/eng-1066-ap1-oauth-helpers
Oct 18, 2026
Merged

lg2m merged 2 commits into
docs/eng-1066-auth-provider-planfrom
refactor/eng-1066-ap1-oauth-helpers

Conversation

@lg2m

@lg2m lg2m commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

AP1: share OAuth transport and bookkeeping helpers

Spec: docs/plans/auth-providers.md (AP1) Linear: ENG-1066 Stacked on: #341

Behaviour-preserving refactor. No user-visible change.

What changed

  • New crates/qq-auth/src/oauth.rs: the HTTPS-only, redirect-free OAuth client; a bounded JSON body reader; the Unix clock; PROVIDER/PROFILE credential names.
  • codex.rs and xai.rs call these instead of their own copies (-76/+18 lines in the flows). Each keeps its own error mapping, so variants and messages are unchanged.

How verified

cargo xtask check

Head 947b1873dbe3 vs origin/main; 8 changed file(s); scope: qq, qq-auth, qq-harness, xtask.

Gate Result Tests Time Command
fmt pass 1.4s cargo fmt --all -- --check
lint pass 1.9s cargo xtask lint
clippy pass 17.8s cargo clippy --color never -p qq -p qq-auth -p qq-harness -p xtask --all-targets --all-features -- -D warnings
test pass 498/498 passed, 2 skipped 38.5s cargo nextest run --color never --profile default -p qq -p qq-auth -p qq-harness -p xtask

All gates passed in 59.7s.

  • cargo nextest run -p qq-auth: 77/77 before (base 9463cc99) and after; no tests added or edited.
  • cargo xtask smoke: 6/6.

Compatibility

  • PROTOCOL / DESCRIPTOR / store schema / stored credential format: unchanged.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-18T02:20:47.038870Z ebb6984 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lg2m

lg2m commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@lg2m
lg2m added this pull request to stack #344 October 16, 2026 16:31

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 947b1873db

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread crates/qq-auth/src/xai.rs Resolved
@lg2m
lg2m force-pushed the refactor/eng-1066-ap1-oauth-helpers branch from 947b187 to 9174a3d Compare October 16, 2026 18:27
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@lg2m

lg2m commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review
Moved the HTTPS verification-URL check into oauth::is_https_url in 9174a3d (and rebased onto the revised plan). qq-auth 77/77; affected gate passes.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 9174a3d079

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@lg2m

lg2m commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review
Only change since your 👍 on 9174a3d: merged the base branch (plan-doc edit, docs/plans/auth-providers.md only) in 14504fb.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 14504fb0ca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@lg2m
lg2m force-pushed the refactor/eng-1066-ap1-oauth-helpers branch from 14504fb to 97ee5c6 Compare October 17, 2026 09:19
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@lg2m

lg2m commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review
Rebased onto main a9bff3e; this PR's own diff is unchanged (same patch-id) since your 👍.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 97ee5c6ded

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

lg2m added 2 commits October 17, 2026 19:19
Slice AP1. The OpenAI Codex and xAI flows each built the same HTTPS-only
OAuth client, bounded JSON body reader, Unix clock and PROVIDER/PROFILE
credential name. One copy now lives in qq-auth's oauth module; each flow
keeps its own error mapping, so messages and variants are unchanged.
Slice AP1 review: the plan lists the HTTPS URL check among the shared
helpers; xAI's device-response validation now calls oauth::is_https_url.
@lg2m
lg2m force-pushed the refactor/eng-1066-ap1-oauth-helpers branch from 97ee5c6 to ebb6984 Compare October 18, 2026 02:20
@lg2m
lg2m merged commit 4c0c482 into main Oct 18, 2026
6 checks passed
@lg2m
lg2m deleted the refactor/eng-1066-ap1-oauth-helpers branch October 18, 2026 02:20
lg2m added a commit that referenced this pull request Oct 18, 2026
…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.
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