feat: use encrypted local secrets for CLI auth - #27539
Merged
Merged
Conversation
celia-oai
marked this pull request as ready for review
June 11, 2026 04:54
Contributor
There was a problem hiding this comment.
💡 Codex Review
codex/codex-rs/core/src/config/mod.rs
Lines 1694 to 1698 in 4775dc3
When secret_auth_storage is only in the cloud bundle, this bootstrap stack lacks that requirement, so restart selects Direct before auth can fetch the bundle. Auth saved in encrypted Secrets by a prior full-config run is then invisible and users resume unauthenticated. guidance
ℹ️ 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".
aibrahim-oai
approved these changes
Jun 11, 2026
celia-oai
force-pushed
the
codex/secret-auth-storage-namespaces
branch
from
June 12, 2026 18:58
53c24ac to
e026ff2
Compare
celia-oai
force-pushed
the
codex/encrypted-cli-auth-storage
branch
3 times, most recently
from
June 12, 2026 20:51
2881d21 to
b8c2e75
Compare
celia-oai
enabled auto-merge (squash)
June 12, 2026 20:55
celia-oai
force-pushed
the
codex/encrypted-cli-auth-storage
branch
from
June 12, 2026 20:58
b8c2e75 to
d43079b
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Why
Windows Credential Manager limits generic credential blobs to 2,560 bytes. Large serialized ChatGPT auth payloads can exceed that limit, so keyring-mode CLI auth needs a backend that keeps only the encryption key in the OS keyring and stores the payload in Codex's encrypted local-secrets file.
This is the third PR in the encrypted-auth stack:
What Changed
CliAuthsecrets namespace.auth.jsonfallback data after successful encrypted saves and removed encrypted, direct-keyring, and fallback data during logout.MCP OAuth persistence is intentionally left to the next PR.
Validation
just test -p codex-login— 131 passedjust test -p codex-cli— 280 passedjust test -p codex-app-server v2::account— 25 passedjust test -p codex-cloud-config service— 21 passed, 7 skippedjust fix -p codex-loginjust fix -p codex-clijust fmt