efrazer-oai
5882f3f95e
refactor: route Codex auth through AuthProvider (#18811)
## Summary
This PR moves Codex backend request authentication from direct
bearer-token handling to `AuthProvider`.
The new `codex-auth-provider` crate defines the shared request-auth
trait. `CodexAuth::provider()` returns a provider that can apply all
headers needed for the selected auth mode.
This lets ChatGPT token auth and AgentIdentity auth share the same
callsite path:
- ChatGPT token auth applies bearer auth plus account/FedRAMP headers
where needed.
- AgentIdentity auth applies AgentAssertion plus account/FedRAMP headers
where needed.
Reference old stack: https://github.com/openai/codex/pull/17387/changes
## Callsite Migration
| Area | Change |
| --- | --- |
| backend-client | accepts an `AuthProvider` instead of a raw
token/header |
| chatgpt client/connectors | applies auth through
`CodexAuth::provider()` |
| cloud tasks | keeps Codex-backend gating, applies auth through
provider |
| cloud requirements | uses Codex-backend auth checks and provider
headers |
| app-server remote control | applies provider headers for backend calls
|
| MCP Apps/connectors | gates on `uses_codex_backend()` and keys caches
from generic account getters |
| model refresh | treats AgentIdentity as Codex-backend auth |
| OpenAI file upload path | rejects non-Codex-backend auth before
applying headers |
| core client setup | keeps model-provider auth flow and allows
AgentIdentity through provider-backed OpenAI auth |
## Stack
1. https://github.com/openai/codex/pull/18757: full revert
2. https://github.com/openai/codex/pull/18871: isolated Agent Identity
crate
3. https://github.com/openai/codex/pull/18785: explicit AgentIdentity
auth mode and startup task allocation
4. This PR: migrate Codex backend auth callsites through AuthProvider
5. https://github.com/openai/codex/pull/18904: accept AgentIdentity JWTs
and load `CODEX_AGENT_IDENTITY`
## Testing
Tests: targeted Rust checks, cargo-shear, Bazel lock check, and CI.
2026-04-23 17:14:02 -07:00
..
2026-04-22 17:48:13 -07:00
2026-04-21 10:22:36 -07:00
2026-04-07 00:32:41 +00:00
2026-04-23 11:46:06 -07:00
2026-04-22 21:20:09 -07:00
2026-04-23 18:54:45 +02:00
2026-04-22 17:00:29 -07:00
2026-04-23 11:54:17 -07:00
2026-04-22 17:00:48 +00:00
2026-04-23 17:14:02 -07:00
2026-04-21 10:44:49 -07:00
2026-04-23 17:14:02 -07:00
2026-04-23 10:17:09 -07:00
2026-04-22 20:34:15 +00:00
2026-04-23 12:46:19 -07:00
2026-04-22 17:14:22 -07:00
2026-04-16 10:51:33 -07:00
2026-04-16 10:51:33 -07:00
2026-04-07 21:20:22 +00:00
2026-04-17 16:18:53 +00:00
2026-04-21 14:30:55 -07:00
2026-04-23 17:14:02 -07:00
2026-04-21 15:37:12 -07:00
2026-04-21 15:37:12 -07:00
2026-04-21 14:30:55 -07:00
2026-04-23 17:14:02 -07:00
2026-04-23 13:28:12 -07:00
2026-04-23 13:28:12 -07:00
2026-04-22 13:34:33 -07:00
2026-04-01 23:06:24 -07:00
2026-04-22 17:00:48 +00:00
2026-04-21 00:54:05 +00:00
2026-04-22 17:00:48 +00:00
2026-04-17 13:27:49 -04:00
2026-04-23 17:14:02 -07:00
2026-04-18 11:01:12 -07:00
2026-04-20 22:39:17 -07:00
2026-04-03 12:07:07 -07:00
2026-04-13 09:59:08 +01:00
2026-04-20 11:51:58 +01:00
2026-04-20 17:21:29 +00:00
2026-04-16 10:31:51 -07:00
2026-04-21 10:44:49 -07:00
2026-04-20 11:23:00 +01:00
2026-04-20 11:23:00 +01:00
2026-04-17 00:51:21 +00:00
2026-04-23 07:33:57 +00:00
2026-04-14 14:26:10 -07:00
2026-04-14 14:26:10 -07:00
2026-04-22 13:34:33 -07:00
2026-04-23 17:14:02 -07:00
2026-04-17 16:18:53 +00:00
2026-04-23 07:33:57 +00:00
2026-04-23 12:21:26 -07:00
2026-04-20 10:27:01 -07:00
2026-04-17 18:34:06 +08:00
2026-04-21 14:30:55 -07:00
2026-04-03 00:33:34 -07:00
2026-04-14 14:26:10 -07:00
2026-04-02 23:00:02 -07:00
2026-04-09 10:53:06 -07:00
2026-04-21 05:05:02 +00:00
2026-04-15 14:43:33 -07:00
2026-04-13 10:26:51 -07:00
2026-04-15 11:34:27 -07:00
2026-04-22 06:10:09 -04:00
2026-04-22 01:08:25 +00:00
2026-04-20 10:27:01 -07:00
2026-04-23 10:17:09 -07:00
2026-04-20 14:04:09 -07:00
2026-04-20 15:43:20 -07:00
2026-04-16 14:30:57 -07:00
2026-04-01 23:06:24 -07:00
2026-04-14 14:26:10 -07:00
2026-04-23 10:17:09 -07:00
2026-04-14 14:26:10 -07:00
2026-04-14 14:26:10 -07:00
2026-04-01 23:06:24 -07:00
2026-04-01 23:06:24 -07:00
2026-04-20 22:39:17 -07:00
2026-04-03 00:33:34 -07:00
2026-04-17 16:18:53 +00:00
2026-04-14 14:26:10 -07:00
2026-04-20 15:15:05 +01:00
2026-04-02 13:47:10 -07:00
2026-04-14 15:40:40 -07:00
2026-04-21 10:22:36 -07:00
2026-04-14 14:26:10 -07:00
2026-04-07 08:03:35 -07:00
2026-04-17 16:18:53 +00:00
2026-04-21 10:22:36 -07:00
2026-04-03 00:33:34 -07:00
2026-04-21 15:29:35 -07:00
2026-04-23 17:49:28 +00:00
2026-04-17 16:18:53 +00:00
2026-04-13 23:11:49 -07:00
2026-04-01 23:06:24 -07:00
2026-04-14 14:26:10 -07:00
2026-04-14 14:26:10 -07:00
2026-04-22 22:24:12 -07:00
2026-04-15 21:48:05 +00:00
2026-04-20 22:39:17 -07:00
2026-04-20 22:39:17 -07:00
2026-04-20 10:27:01 -07:00
2026-04-03 00:33:34 -07:00
2026-04-01 23:06:24 -07:00
2026-04-01 23:06:24 -07:00
2026-04-08 08:42:18 -07:00
2026-04-08 08:42:18 -07:00