Skip to content

refactor(auth): own built-in credential audiences in qq-auth (ENG-1066) - #346

Merged
lg2m merged 1 commit into
refactor/eng-1066-ap2-refresh-lockfrom
refactor/eng-1066-ap3-audiences
Oct 18, 2026
Merged

lg2m merged 1 commit into
refactor/eng-1066-ap2-refresh-lockfrom
refactor/eng-1066-ap3-audiences

Conversation

@lg2m

@lg2m lg2m commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator

AP3: own built-in credential audiences in qq-auth

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

Behaviour-preserving refactor. No user-visible change. Every audience value is identical.

What changed

  • qq-provider no longer exports XAI_CREDENTIAL_ENDPOINT. It named a vendor credential audience but never used it, and qq-config only re-exported it to the root.
  • qq-auth now exports OPENAI_CODEX_CREDENTIAL_ENDPOINT (https://chatgpt.com) and XAI_CREDENTIAL_ENDPOINT (https://api.x.ai), next to the stored credentials they bind. codex.rs and xai.rs use them.
  • src/runtime.rs, src/doctor.rs and src/main.rs (built_in_endpoint) use the qq-auth constants instead of URL literals.
  • docs/design/providers.md no longer lists the constant among qq-provider's exports and says qq-auth owns vendor audiences.
  • No new crate dependency edge: the root already depends on qq-auth.
  • Deferred to AP7, as the plan states: the "openai-codex/{}" and "xai/{}" stored-name literals in root code. A fallible shared helper would add error paths those sites don't have.

How verified

cargo xtask check

Head b53bd17bed06 vs origin/main; 15 changed file(s); scope: qq, qq-auth, qq-client, qq-config, qq-core, qq-harness, qq-mcp, qq-provider, qq-server, qq-tui, xtask.

Gate Result Tests Time Command
fmt pass 1.6s cargo fmt --all -- --check
lint pass 2.2s cargo xtask lint
clippy pass 19.0s cargo clippy --color never -p qq -p qq-auth -p qq-client -p qq-config -p qq-core -p qq-harness -p qq-mcp -p qq-provider -p qq-server -p qq-tui -p xtask --all-targets --all-features -- -D warnings
test pass 2595/2595 passed, 15 skipped 227.5s cargo nextest run --color never --profile default -p qq -p qq-auth -p qq-client -p qq-config -p qq-core -p qq-harness -p qq-mcp -p qq-provider -p qq-server -p qq-tui -p xtask
minimal-clippy pass 0.3s cargo clippy --color never -p qq-provider --no-default-features --features test-support --all-targets -- -D warnings
minimal-test pass 211/211 passed, 0 skipped 2.8s cargo nextest run --color never --profile default -p qq-provider --no-default-features --features test-support

All gates passed in 253.4s.

  • No tests added or edited.
  • cargo xtask smoke: 6/6.

Compatibility

  • PROTOCOL / DESCRIPTOR / store schema / stored credentials: unchanged.
  • API: qq_provider::XAI_CREDENTIAL_ENDPOINT and qq_config::XAI_CREDENTIAL_ENDPOINT are removed in favour of qq_auth::XAI_CREDENTIAL_ENDPOINT. All three crates are publish = false, and every in-workspace user is migrated.

@lg2m

lg2m commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 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:40.899000Z 4ea47cc 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.

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

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: b53bd17bed

ℹ️ 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 added this pull request to stack #344 October 17, 2026 08:42
@lg2m
lg2m force-pushed the refactor/eng-1066-ap3-audiences branch from b53bd17 to 5f22804 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).

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 5f22804fc9

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

Slice AP3. qq-provider exported XAI_CREDENTIAL_ENDPOINT, a vendor
credential audience it never used, and qq-config re-exported it to the
root. Both audiences now live beside the stored credentials they bind in
qq-auth (OPENAI_CODEX_CREDENTIAL_ENDPOINT, XAI_CREDENTIAL_ENDPOINT); the
runtime, doctor and auth CLI use them instead of URL literals. Values are
unchanged. The design note and plan say what remains for AP7.
@lg2m
lg2m force-pushed the refactor/eng-1066-ap3-audiences branch from 5f22804 to 4ea47cc Compare October 18, 2026 02:20
@lg2m
lg2m merged commit 332e8a6 into main Oct 18, 2026
5 of 6 checks passed
@lg2m
lg2m deleted the refactor/eng-1066-ap3-audiences branch October 18, 2026 02:20
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