Files
codex/codex-rs
arnavpatidar-OAI 283fca1c98 Extend OAuth configuration for managed gateways (#65188)
## Why

Setting custom OAuth scopes or a client ID for a managed gateway required
hard-coding the authorization and token URLs, even when the server
published them through discovery.

## What changed

Omit both `authorization_url` and `token_url` in `[gateway.auth]` or
`[config_server.oauth]` to discover the endpoints while configuring
`client_id`, `scopes`, `resource`, `redirect_port`, or
`device_authorization_url`. An OAuth block that relies on discovery
produces an error if metadata is unavailable.

Managed gateways can also set `gateway.requires_openai_auth` and
`gateway.auth.delivery` for inference. For example, a gateway can use
`Authorization` for the OpenAI credential and receive its OAuth token
in `X-Gateway-Authorization`. Enrollment rejects configurations that
would send both credentials in `Authorization`.

## Testing

Add coverage for discovery overrides, missing discovery metadata,
invalid OAuth settings, and gateway token delivery.

GitOrigin-RevId: 84e0c219c9eb78d4be538e9131e15ab39fd597b9
2026-12-02 07:13:07 +00:00
..
…
…
…
…