-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Support any dynamic credentials in VaultCredentialsProvider #21279
Conversation
A follow on PR for the actual RabbitMQ changes can be viewed at kdubb@276c300. It requires a change to the |
@vsevel Feedback on this would be great. Just wanting to know if this is a good direction that is acceptable to the team. |
This workflow status is outdated as a new workflow run has been triggered. Failing Jobs - Building 09b5dd4
Full information is available in the Build summary check run. Failures⚙️ JVM Tests - JDK 11 #- Failing: integration-tests/vault
📦 integration-tests/vault✖
⚙️ JVM Tests - JDK 17 #- Failing: integration-tests/vault
📦 integration-tests/vault✖
⚙️ Native Tests - Security3 #- Failing: integration-tests/vault
📦 integration-tests/vault✖
⚙️ Native Tests - Windows - hibernate-validator #- Failing: integration-tests/hibernate-validator
📦 integration-tests/hibernate-validator✖ |
09b5dd4
to
df3a8fa
Compare
This workflow status is outdated as a new workflow run has been triggered. Failing Jobs - Building df3a8fa
Failures⚙️ Native Tests - Windows - hibernate-validator #- Failing: integration-tests/hibernate-validator
📦 integration-tests/hibernate-validator✖ |
df3a8fa
to
5ecf0e2
Compare
This workflow status is outdated as a new workflow run has been triggered. Failing Jobs - Building 5ecf0e2
Full information is available in the Build summary check run. Failures⚙️ Gradle Tests - JDK 11 Windows #- Failing: integration-tests/gradle
📦 integration-tests/gradle✖
⚙️ Native Tests - Windows - hibernate-validator #- Failing: integration-tests/hibernate-validator
📦 integration-tests/hibernate-validator✖ |
5ecf0e2
to
b60e125
Compare
This workflow status is outdated as a new workflow run has been triggered. Failing Jobs - Building b60e125
Failures⚙️ Native Tests - Windows - hibernate-validator #- Failing: integration-tests/hibernate-validator
📦 integration-tests/hibernate-validator✖ |
@sberyozkin we have had a long chat with @kdubb yesterday about this PR. we have agreed on the direction. |
fd857ae
to
24c4558
Compare
874cd34
to
e164aac
Compare
@vsevel Can we get this reviewed and merged? I've rebased and updated the relevant docs. The SmallRye RabbitMQ connector version I need to finish dynamic credentials support is now available. Just need to get this in and I can submit that PR. |
I'm not sure there is a strong enough reason to introduce a breaking change with the |
@sberyozkin I'm not sure these should be considered outwardly breaking changes. These classes are internal and provide configuration based dynamic credentials; I'm gonna bet that nobody injects any of those classes. If you were gonna inject any of these you'd inject the Additionally, we need to add configurable values (e.g. @vsevel and I had a long chat about this to agree on the new names and configuration value names as well. |
...s/vault/runtime/src/main/java/io/quarkus/vault/runtime/config/CredentialsProviderConfig.java
Show resolved
Hide resolved
@sberyozkin We also agreed to add the |
e164aac
to
d77f8dd
Compare
@kdubb Thanks for the explanation |
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.
Please update the 2.6 migration guide
@sberyozkin it's a wiki so @kdubb can't. @kdubb, if you provide a section in Markdown, I will add it there: https://github.com/quarkusio/quarkus/wiki/Migration-Guide-2.6 . @sberyozkin @vsevel if this one is ready, I would prefer we merge it really soon as I'd like it to be in before I move the Vault extension outside of the Core. I plan to do that either tomorrow afternoon or on Monday. |
hello @kdubb. thanks for this contribution. I will go through our chat (there may be some elements from the discussion we can share here for transparency and would help explain the rationale plus support discussion) again tomorrow and spend some time on the review. |
@gsmet The only changes worth noting in migration are the deprecation of the Suggested excerpt for the migration guide: Vault Datasource Credentials ProviderThe configuration for Vault dynamic datasource credentials was changed as more more types of dynamic credentials are supported. Specifically the Using the example from the Dynamic Database Credentials guide. The previously configuration of: quarkus.vault.credentials-provider.mydatabase.database-credentials-role=mydbrole Changes to: quarkus.vault.credentials-provider.mydatabase.credentials-role=mydbrole
quarkus.vault.credentials-provider.mydatabase.credentials-mount=database Note that the previous configuration key of |
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.
Hello @kdubb I have mainly 2 comments:
- I think we should have a credentials type config parameter separated from the mount point
- Then we should probably have calculated defaults for the mount and forced values for the request path based on this credentials type
open to discussion.
extensions/vault/runtime/src/main/java/io/quarkus/vault/runtime/VaultCredentialsProvider.java
Show resolved
Hide resolved
...ons/vault/runtime/src/main/java/io/quarkus/vault/runtime/VaultDynamicCredentialsManager.java
Show resolved
Hide resolved
...s/vault/runtime/src/main/java/io/quarkus/vault/runtime/config/CredentialsProviderConfig.java
Outdated
Show resolved
Hide resolved
...ons/vault/runtime/src/main/java/io/quarkus/vault/runtime/VaultDynamicCredentialsManager.java
Outdated
Show resolved
Hide resolved
integration-tests/vault/src/test/java/io/quarkus/vault/VaultITCase.java
Outdated
Show resolved
Hide resolved
@vsevel Using If we were to be more pedantic and have a So, in my opinion, the only thing I think we should be considering is a name change of the |
Actually, if we were to change |
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.
Please coordinate with me (@gsmet) before merging this as we don't want to merge this after I moved the code to the Quarkiverse.
d77f8dd
to
58e7523
Compare
@kdubb I vote for replacing the type by |
eb734d8
to
43eac92
Compare
@vsevel Renamed |
…alsProvider This change is in preparation of support for dynamic Vault credentials for RabbitMQ. It renames the "database" dynamic credentials supports to use "dynamic" in the names in an effort to be clear about its use. Vault dynamic credentials all have basicallly identical responses so the credentials provider should support any of them easily. This does essentially 4 things. 1. Renames `VaultDatabaseCredentials`, `VaultDBManager` and supporting classes to use the naming "Dynamic" 2. Renames & deprecates `databaseCredentialsRole` to `credentialsRole` 3. `credentialsMount` config and adds this as a parameter to `VaultDynamicCredentialsManager.getDynamicCredentials` 4. Adds an `expires-at` property to the returned credentials which is calculated from the Vault lease duration.
43eac92
to
cd23d5d
Compare
@gsmet Squished and rebased and I updated the migration blurb above. |
Let's merge this, thanks! |
This change is in preparation of support for dynamic Vault credentials for RabbitMQ. It renames the "database" dynamic credentials supports to use "dynamic" in the names in an effort to be clear about its use.
Vault dynamic credentials all have basicallly identical responses so the credentials provider should support any of them easily.
This does essentially 4 things.
VaultDatabaseCredentials
,VaultDBManager
and supporting classes to use the naming "Dynamic"databaseCredentialsRole
tocredentialsRole
credentialsMount
config and adds this as a parameter toVaultDynamicCredentialsManager.getDynamicCredentials
expires-at
property to the returned credentials which is calculated from the Vault lease duration.