-
Notifications
You must be signed in to change notification settings - Fork 27
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
Vault DB credentials provider with reactive-pg-client #78
Comments
This issue started showing up from "quarkus.platform.version" Quarkus 2.12.0.Final. |
Unable to enable vault credentials provider for pgsql database due to: quarkiverse/quarkus-vault#78
I'll have a look tomorrow |
Actually.... the reporter opened another (different) issue: #99 |
So we have multiple problems? |
Looks like it... |
I'll have a look |
I think I have found the problem - it seems to be a Quarkus issue |
Thanks for looking at it folks! Please do let me know if I can help in any way |
This turns out to be more complex than I thought... Essentially the problem is that when creating the synthetic bean for the The way I see it, we only have two options, neither of which is pretty:
public interface CredentialsProvider {
Map<String, String> getCredentials(Input input);
interface Input {
String credentialsProviderName();
Vertx vertx();
}
} We could make this new method a default method that returns an empty map and update the Javadoc of P.S. Cases like show why we should almost always use this |
simple repro |
@cescoffier @mkouba WDYT about what I mentioned in my previous comment? |
This is needed because the VertxVaultClient can potentially be used inside a Synthetic bean and in such cases obtaining Vertx which is itself a synthetic bean is not possible Fixes: quarkiverse#78
Actually, #109 should work around the issue. It's a hack obviously :) |
All synthetic RUNTIME_INIT beans are initialized in one go during Just to sum it up: a synthetic bean for We cannot use lazy bean loading here because the |
This is needed because the VertxVaultClient can potentially be used inside a Synthetic bean and in such cases obtaining Vertx which is itself a synthetic bean is not possible Fixes: #78
@kdubb could you cut a release with this fix? |
did this fix the error? I just tried using the extension with the repro and get the same error. I also cloned this repo and built + used my local maven instead of pulling the extension so I'm not sure if the fix worked |
Did you test with the snapshot version generated from the repo? |
ah, using the snapshot I get a different error:
|
Do you have a sample project we can look at? |
I was using the vault-issue-repro that @raffaelespazzoli attached above |
@raffaelespazzoli What do I need to do to test with your repro project? When I run with the fix applied I get this error
This at least tells me that Vault is being called properly but I'd let to get a successful test before I call it fixed. |
Obviously the Vault instance isn't initialized properly. Have you got an init script? The extension supports initializing a DevServices instance using quarkus.vault.devservices.init-commands |
@kdubb I have another sort of repro here: https://github.com/ingmarfjolla/quarkus-reactive/tree/main/reactivequarkusorderservice that just fails on startup with the same original error (I also upgraded to Quarkus 3.0) :
to start the app I just do |
we verified that this fix works with a local build, can we get a release containing this fix? @kdubb |
@raffaelespazzoli I will get something out this weekend. |
Great news BTW! |
🎉 |
Hello!
I'm struggling with setting up Vault credentials provider for postgres DB, while using reactive-stack as much as possible. I'm getting the following stack trace:
I have got the following dependencies:
And application.yml file:
Interesting fact is that I can manually get credentials for
postgres
mount, via Postman, yet it seems that this call is never performed by Vault in Quarkus.Also, when I replace the credentials provider with username and password, everything works well.
Would you see any issues in my setup?
Thanks!
Michal
The text was updated successfully, but these errors were encountered: