feat: add secret auth storage configuration (#27504)

## Why

Windows Credential Manager limits generic credential blobs to 2,560
bytes. The encrypted local secrets backend avoids storing large
serialized auth payloads directly in the OS keyring, but selecting that
backend needs an independently reviewable feature/config layer before
the auth and secrets implementation is wired in.

## What Changed

- Added the stable `secret_auth_storage` feature, enabled by default on
Windows and disabled by default elsewhere.
- Added `AuthKeyringBackendKind` and config resolution for full and
bootstrap config loading.
- Applied managed feature requirements when resolving the bootstrap auth
backend.
- Updated the generated config schema and added focused tests.

This is the base PR for #17931. The auth, secrets, MCP, CLI, TUI, and
app-server implementation remains in that follow-up PR.

## Validation

- `just test -p codex-features`
- `just test -p codex-config`
- `just test -p codex-core
resolve_bootstrap_auth_keyring_backend_kind_uses_secret_auth_storage_feature`
- `just write-config-schema`
- `just fix -p codex-core`

The full `just test -p codex-core` run compiled successfully and ran
2,690 tests; 2,589 passed, one was flaky, and 101 environment-sensitive
tests failed because this shell injects a `pyenv` rehash warning into
command output or because sandboxed subprocesses timed out.
This commit is contained in:
Celia Chen
2026-06-12 12:15:21 -07:00
committed by GitHub
Unverified
parent 76d8f20241
commit b724f5966e
8 changed files with 213 additions and 1 deletions
+8
View File
@@ -81,6 +81,8 @@ pub enum Feature {
ShellTool,
/// Enable Claude-style lifecycle hooks loaded from hooks.json files.
CodexHooks,
/// Store CLI auth in the encrypted local secrets backend when keyring storage is selected.
SecretAuthStorage,
// Experimental
/// Enable JavaScript code mode backed by the in-process V8 runtime.
@@ -748,6 +750,12 @@ pub const FEATURES: &[FeatureSpec] = &[
stage: Stage::Stable,
default_enabled: true,
},
FeatureSpec {
id: Feature::SecretAuthStorage,
key: "secret_auth_storage",
stage: Stage::Stable,
default_enabled: cfg!(windows),
},
FeatureSpec {
id: Feature::UnifiedExec,
key: "unified_exec",
+10
View File
@@ -189,6 +189,16 @@ fn tool_search_is_removed_and_disabled_by_default() {
assert_eq!(feature_for_key("tool_search"), Some(Feature::ToolSearch));
}
#[test]
fn secret_auth_storage_defaults_to_windows_only() {
assert_eq!(Feature::SecretAuthStorage.stage(), Stage::Stable);
assert_eq!(Feature::SecretAuthStorage.default_enabled(), cfg!(windows));
assert_eq!(
feature_for_key("secret_auth_storage"),
Some(Feature::SecretAuthStorage)
);
}
#[test]
fn browser_controls_are_stable_and_enabled_by_default() {
assert_eq!(Feature::InAppBrowser.stage(), Stage::Stable);