feat: implement token-exchange auth for HashiCorp Vault#5821
Merged
Conversation
wolf4ood
approved these changes
Jun 16, 2026
e881045 to
334da6b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HashicorpJwtTokenProviderandHashicorpVaultCredentialswith a newHashicorpTokenExchangeProviderthat implements RFC 8693 token exchange via an external service (e.g.jwtlet)HashicorpVaultTokenProviderFactoryImplwhich selects between static-token and token-exchange authentication based on configuration, supporting both simultaneously for mixed deployments (default vault partition uses a static token; per-participant partitions use token exchange)resourceso issued Vault tokens are scoped to individual participantsMotivation
In Kubernetes workload-identity deployments the connector should not hold a long-lived static Vault token, nor should credentials be stored in the database, if it can be helped.
Instead, the control plane presents its projected ServiceAccount token to a token-exchange service, which issues a short-lived, participant-scoped JWT that is then authenticated against Vault's JWT auth method. This enables fine-grained, per-participant Vault access without distributing static secrets.
This is somewhat similar to the previous JWT authentication method, because JWTs are used to authenticate against vault. The change is in the way how tokens are obtained: Oauth2 Client Credentials flow (old) vs. OAuth2 Token Exchange (new).
🤖 Generated with Claude Code