mirror of
https://github.com/openai/codex.git
synced 2026-10-21 17:48:44 +00:00
Record OAuth provenance and login identity for account tokens (#55397)
## Why Token refresh needs the issuer and client ID used at login. Unverified token claims cannot establish that authority, and OAuth error bodies may echo credentials. ## What changed - Save `oauth_provenance` and a new `login_owner_id` on browser and device-code login. Preserve the login identifier through token rotation. - Refresh using the recorded issuer and client ID, retaining the existing endpoint override and fallback behavior for legacy records. Clear provenance when an override changes the endpoint or when a response without token rotation encounters a concurrently replaced refresh token. - Keep both metadata fields optional for older records without inferring provenance from token claims. - Remove backend token error details from structured logs and refresh error messages. - Box large futures in token refresh, MCP initialization, and embedded app-server test startup to reduce surrounding async frame sizes. ## Testing Add coverage for legacy record compatibility and metadata round trips, browser and device-code login persistence, refresh using recorded OAuth settings, metadata preservation through rotation, and provenance clearing for a superseded refresh token. GitOrigin-RevId: b6b5d2fcbe2a284a171a242c1a17128af55f1024
This commit is contained in:
@@ -1947,12 +1947,13 @@ impl Session {
|
||||
} else {
|
||||
mcp_projection
|
||||
};
|
||||
sess.install_initial_mcp_runtime(
|
||||
// Keep MCP startup's large future out of the surrounding session initialization frame.
|
||||
Box::pin(sess.install_initial_mcp_runtime(
|
||||
&session_configuration,
|
||||
latest_auth,
|
||||
mcp_projection,
|
||||
&resolved_environments,
|
||||
)
|
||||
))
|
||||
.await?;
|
||||
sess.start_mcp_prewarm_worker(mcp_prewarm_rx, mcp_auth_changes);
|
||||
sess.follow_inherited_environment_configurations(
|
||||
|
||||
Reference in New Issue
Block a user