Files
codex/codex-rs
alexsong-oai 4d23af0975 Compose gateway OAuth with primary provider authentication (#46490)
## Why

Providers configured with `gateway_oauth` need gateway credentials alongside primary authentication for inference and model discovery.

## What changed

- Attach gateway tokens through the configured header or cookie while preserving primary authentication, including WebSocket handshake headers.
- Share gateway credential managers across matching provider instances and model discovery so they observe refreshed tokens.
- Reject authentication on gateway setup or token failures, invalid token values, and conflicting auth headers. Mark gateway headers sensitive and avoid exposing issuer error details.
- Include gateway OAuth configuration in model catalog cache identity to prevent reuse across different gateway configurations.

## Testing

Add provider and core integration tests covering combined credentials, header and cookie delivery, token refresh, shared credential state, cache isolation, and request blocking on gateway token or HTTP client initialization failures.

GitOrigin-RevId: cb74125cf7e87660967d49edacf14646cf0b99c4
2026-09-18 22:42:46 +00:00
..