Files
codex/codex-rs/network-proxy/src
viyatb-oai 6aa4504d66 Add refreshable JWT bearer grants for network proxy tests (#64834)
## Why

A guest needs a stable JWT alias even when the upstream bearer expires
or is invalidated. A disconnect during refresh can leave a rotating
credential already spent, so concurrent and subsequent requests need
to share the in-flight exchange.

## What changed

Add `JwtBearerGrant` behind `#[cfg(test)]`. It exposes a decodable alias
with explicitly selected scalar claims, reuses current bearers, and
refreshes on demand. A refreshed token must preserve the grant's
identity and disclosed claims.

Invalidation makes previously resolved bearers unusable. Revocation
also blocks future refreshes, and a failed or ambiguous refresh
permanently revokes the grant.

## Testing

Cover shared refreshes, request cancellation, invalidation and
revocation during refresh, timeouts, and claim consistency across
token rotation.

GitOrigin-RevId: 67cdf18e5aafa9dbc7290a2ef8ba62da84f826c5
2026-12-01 00:28:01 +00:00
..