Open Sharofiddin opened 1 year ago
@Sharofiddin Sorry for the late reply!
The Vault extension is working properly with this support; it's just that requesting the username from a key-value secret store is not supported.
Currently only quarkus.vault.credentials-provider.kv-key
is declared as a configuration point. This configuration is used to lookup the password from the secret store. There is no configuration for the username's store key.
What we need to do to support this is rename kv-key
to kv-password-key
and then add a kv-username-key
configuration.
Adding defaults of username
for kv-username-key
and password
for kv-password-key
is probably a good idea too.
This will require changing the type of the kvKey
config property to an Optional (to allow for deprecation). This means this will have to go into the 3.0
release.
When using credentials-provider which is default hashicorp vault, if I define get password from Vault it is working weel, but when I try to get datasource.username from Vault I am getting error
this one is not working, and if I add
It is working well. This is my vault configurations:
I tried
username
keyword too.But the same result. Error decription:After digging into io.quarkus.vault.runtime.VaultCredentialsProvider from quarkus-vault:2.1.0 lib I found this code
I think this is the route of the issue: value for
USER_PROPERTY_NAME
key will not be added to the final result when kvPath is present. But according to the official guide datasource username should be read from Vault if it is not exist in application.properties file, as guide says: Note that quarkus.datasource.username is the original agroal property, whereas the password property is not included because the value will come from the mydatabase credentials provider we just defined. An alternative is to define both username and password in Vault and drop the quarkus.datasource.username property from configuration. All consuming extensions do support the ability to fetch both the username and password from the provider, or just the password. My quarkus version: 2.15.1 Java : amazon-corretto-17 Maven: 3.8.6