You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Kind e2e for refresh tokens issued by token exchange #6965
Problem: refresh tokens issued by token exchange are tested in process only. Nothing proves the path end to end, on a VirtualMCPServer with Redis storage: a real login, issuance, refusal of a replayed subject token, isolation from the refresh-token grant, and child grants.
Change: a Ginkgo test in test/e2e/thv-operator/virtualmcp/, next to the delegate-client Redis test. It reuses that test's Redis deployment and port-forward, and the Dex upstream from the delegate-client upstream test. The VirtualMCPServer has a configured client with these grant types: token exchange, authorization code, and refresh token. It also has a redirect URI, an API audience, and refresh-token caps for both output types. The e2e login helper for configured clients logs in through Dex.
Acceptance, in kind:
The login access token's aud includes the API audience.
Exchanging it for a grant that issues refresh tokens returns token_typeN_A, and the echoed entry carries a capped expires_at.
Replaying the same access token is refused with token_used.
The issued token at grant_type=refresh_token gets invalid_grant.
Deriving a child grant that issues ID-JAGs succeeds.
Pod logs contain exchange_grant.created and exchange_grant.derived, and no token values.
We decided to not expose the codepath through CRDs just yet to limit the exposure, this also means we won't be adding a kind e2e test just yet. The CRDs, if we need to resurrect them later, are in the exchange-crd branch I just pushed into origin.
Activity
jhrozek commentedon Oct 30, 2026
We decided to not expose the codepath through CRDs just yet to limit the exposure, this also means we won't be adding a kind e2e test just yet. The CRDs, if we need to resurrect them later, are in the
exchange-crdbranch I just pushed into origin.