Skip to content
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

Add Azure Key Vault Extension #218

Merged
merged 40 commits into from
Apr 30, 2024

Conversation

galiacheng
Copy link
Contributor

@galiacheng galiacheng commented Apr 25, 2024

This PR is related to #63, including:

  • Support to automatically configure SecretClient and SecretAsyncClient bean with property quarkus.azure.keyvault.secret.endpoint.
  • Support native build.
  • Enable building/testing/releasing Key Vault Extension in workflow pipelines.
  • Add unit tests.
  • Add integration tests.
  • Add doc.
  • Update README.

Test: https://github.com/galiacheng/quarkus-azure-services/actions/runs/8829692524

Comment on lines +27 to +28
String dir = "QMETA-INF/services";
String hotspotLibName = "jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment explaining what the QMETA-INF/services thing is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See 37c8dc9.

Comment on lines 60 to 61
.filter(n -> n.startsWith("com.azure.security.keyvault.secrets.models."))
.sorted()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By loading the classes in this way, we are creating an implicit contract: All of the classes that start with this package are "safe" to load in this way. Do we know this will always be true?

Copy link
Contributor Author

@galiacheng galiacheng Apr 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The safest approach is to load the exact classes, see 5fce42c.

Comment on lines +83 to +84
.filter(s -> s.startsWith("com.azure.security.keyvault.secrets.implementation.models."))
.forEach(e -> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is safe to use a startsWith approach here because we are pre-filtering with the getAllKnownImplementors.

Comment on lines 120 to 124
### Creating Azure Key Vault

Run the following commands to create an Azure Key Vault, set permission and export its connection string as an environment
variable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mention that the steps listed here are also performed by the GitHub Actions workflows via the build-with-native.sh file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, see 5fce42c.

Comment on lines +75 to +78
az keyvault create \
--name ${KEY_VAULT_NAME} \
--resource-group ${RESOURCE_GROUP_NAME} \
--location eastus
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mention this duplicates code in integration-tests/README.md.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See 5fce42c.

Comment on lines +74 to +78
```
KEY_VAULT_NAME=<unique-key-vault-name>
az keyvault create --name ${KEY_VAULT_NAME} \
--resource-group ${RESOURCE_GROUP_NAME} \
--location eastus
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mention the GitHub Actions workflow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See 5fce42c.

@majguo
Copy link
Contributor

majguo commented Apr 30, 2024

LGTM now, approved.

@majguo majguo merged commit adf8af9 into quarkiverse:main Apr 30, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants