-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: make HashiCorp vault authentication extensible #4822
base: main
Are you sure you want to change the base?
feat: make HashiCorp vault authentication extensible #4822
Conversation
1010cbf
to
611b5ec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would put this in the spi
folder, at the moment all the spis reside there (apart from some dsp
ones, that I think they should be put there as well)
* Copyright (c) 2022 Mercedes-Benz Tech Innovation GmbH | ||
* Copyright (c) 2025 Cofinity-X |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copyright
|
||
private Headers getHeaders() { | ||
private Headers getHeaders(String token) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given that tokenProvider
is a class field, maybe it could be used internally in this method instead of having the token passed every time
assertThat(tokenLookUpResult).isFailed(); | ||
assertThat(tokenLookUpResult.getFailureDetail()).isEqualTo("Token look up failed with status 403"); | ||
Assertions.assertThat(tokenLookUpResult.getFailureDetail()).isEqualTo("Token look up failed with status 403"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: static import
|
||
@Provider(isDefault = true) | ||
public HashicorpVaultTokenProvider tokenProvider() { | ||
return new HashicorpVaultTokenProviderImpl(config.token()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given that the token is only used in this extension maybe it could make sense to remove it from the Settings
class and put it here as a single @Setting
, it would also improve the way it's documented through autodoc
What this PR changes/adds
Refactors the
vault-hashicorp
module as outlined in this DR.Why it does that
To make vault authentication extensible and thus enable using different authentication methods.
Further notes
In addition to what's already mentioned in the DR:
HashicorpVaultTokenRenewService
, which now contains the token look-up & renew methods previously located in the health service. I did not add them to theHashicorpVaultTokenRenewTask
directly, to keep a separation between the methods for renewing the token and the periodic task triggering the token renewal.vault-hashicorp-spi
, which as of now contains only theHashicorpVaultTokenProvider
interface.Who will sponsor this feature?
me
Linked Issue(s)
Closes #4810
Closes #4751