[codex] Add externally provided Codex auth (#31274)

## Summary

Add an in-memory externally provided Codex auth snapshot with explicit
runtime capabilities, installed through the existing `ExternalAuth`
provider path.

## Testing

- `just fmt-check`
- `cargo test -p codex-login --lib externally_provided_auth`
- `cargo test -p codex-core --lib
external_auth_snapshot_is_installed_from_runtime_config`
- `cargo test -p codex-model-provider --lib external_auth`
- `cargo test -p codex-mcp-extension --test hosted_apps_mcp
hosted_apps_mcp_accepts_external_provided_codex_auth`
- `cargo check -p codex-app-server -p codex-core-api -p
codex-thread-manager-sample`

---------

Co-authored-by: pakrym-oai <pakrym@openai.com>
This commit is contained in:
lt-oaiandpakrym-oai authored and GitHub committed 2026-07-07 17:43:19 -07:00
1 parent dbd2df27d1
commit 8784de445e
29 files changed
+278 -7

No files matched your search

+4
View File
@@ -277,6 +277,9 @@ impl ModelProvider for ConfiguredModelProvider {
if auth_manager.refresh_failure_for_auth(&auth).is_some() {
return None;
}
if matches!(auth, CodexAuth::Headers(_)) {
return None;
}
Some(auth)
})
.map(|auth| match &auth {
@@ -286,6 +289,7 @@ impl ModelProvider for ConfiguredModelProvider {
}
CodexAuth::Chatgpt(_)
| CodexAuth::ChatgptAuthTokens(_)
| CodexAuth::Headers(_)
| CodexAuth::AgentIdentity(_)
| CodexAuth::PersonalAccessToken(_) => {
let email = auth.get_account_email();