Skip to content

Kind e2e for refresh tokens issued by token exchange #6965

Closed

Description

@jhrozek

Part of #6886. Depends on #6897.

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:

  1. The login access token's aud includes the API audience.
  2. Exchanging it for a grant that issues refresh tokens returns token_type N_A, and the echoed entry carries a capped expires_at.
  3. Replaying the same access token is refused with token_used.
  4. The issued token at grant_type=refresh_token gets invalid_grant.
  5. Deriving a child grant that issues ID-JAGs succeeds.
  6. Pod logs contain exchange_grant.created and exchange_grant.derived, and no token values.

Activity

  1. added
    needs-triage
    on Oct 27, 2026
  2. jhrozek commented on Oct 30, 2026

    @jhrozek
    ContributorAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions