Skip to content

Ensure property-defined Vault token is used when auth is TOKEN#3178

Merged
ryanjbaxter merged 2 commits into
spring-cloud:4.3.xfrom
johnycho:fix-3172
Jan 14, 2026
Merged

Ensure property-defined Vault token is used when auth is TOKEN#3178
ryanjbaxter merged 2 commits into
spring-cloud:4.3.xfrom
johnycho:fix-3172

Conversation

@johnycho

Copy link
Copy Markdown
Contributor

Prior to this commit, SpringVaultTemplateBuilder ignored the configured static token if spring.cloud.config.server.vault.authentication was explicitly set to TOKEN. This caused the application to incorrectly fall back to default authentication mechanisms (e.g., filesystem token) even when a token was provided in the properties.

This change updates the isStaticToken predicate to return true when a token is present and the authentication method is either null (default) or explicitly set to TOKEN.

A unit test has been added to ensure the default ConfigTokenProvider is ignored in this scenario.

Fixes gh-3172

Signed-off-by: johnycho <shunnn215@gmail.com>
@osohyun0224

Copy link
Copy Markdown

@johnycho Wow! Respecting the explicitly configured token when authentication=TOKEN is set aligns much better with expected behavior, and the added unit test strengthens confidence in the change. I hope this gets merged :)

@ryanjbaxter
ryanjbaxter merged commit b755a62 into spring-cloud:4.3.x Jan 14, 2026
2 checks passed
@ryanjbaxter

Copy link
Copy Markdown
Contributor

Thank you. In the future please be sure to run the full build before submitting the PR to catch errors like this 11e1d45

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vault authentication uses non-existing token instead of spring.cloud.config.server.vault.authentication

4 participants