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

Make KeyVaultJcaProvider can work when keyvault-uri is not set. #22488

Conversation

chenrujun
Copy link

  1. Make KeyVaultJcaProvider can work when keyvault-uri is not set.
  2. Delete unused property: azure.keyvault.aad-authentication-url
  3. Reuse the code in test.
  4. Rename KeyVaultProperties to AzureKeyVaultProperties.
  5. Add AzureCertPathProperties.

2. Delete unused property: azure.keyvault.aad-authentication-url
3. Reuse the code in test.
4. Rename KeyVaultProperties to AzureKeyVaultProperties.
5. Add AzureCertPathProperties.
@ghost ghost added KeyVault azure-spring All azure-spring related issues labels Jun 24, 2021
@chenrujun chenrujun self-assigned this Jun 24, 2021
@chenrujun chenrujun added this to the [2021] August milestone Jun 24, 2021
@chenrujun
Copy link
Author

Hi, @lzc-1997-abel .
Please help to review this PR.

@chenrujun
Copy link
Author

/azp run java - spring - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@chenrujun
Copy link
Author

/check-enforcer override

@zhichengliu12581
Copy link
Contributor

LGTM

Copy link
Member

@yiliuTo yiliuTo left a comment

Choose a reason for hiding this comment

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

LGTM

* @see <a href="https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-configuration-metadata.html">Metadata</a>
*/
@EnableConfigurationProperties({ AzureCertPathProperties.class })
@ConfigurationProperties("azure.cert-path")
Copy link
Member

Choose a reason for hiding this comment

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

we should discuss this property name, azure.cert-path.custom seems not a clear name to me

Copy link
Author

Choose a reason for hiding this comment

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

Current property name is the conclusion discussed with @gavinfish
Refs: #21611 (comment)

return;
}

putEnvironmentPropertyToSystemProperty(environment, "azure.keyvault.aad-authentication-url");
Copy link
Member

Choose a reason for hiding this comment

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

I'd suggest to add a warning message in log to warn users still having this property configed

Copy link
Author

Choose a reason for hiding this comment

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

Maybe it's not necessary, because:

  1. If customer use azure-spring-boot-starter-keyvault-certificates, azure.keyvault.aad-authentication-url never exist in KeyVaultProperties.java, so customer never know this property exists.

Refs: https://github.com/Azure/azure-sdk-for-java/commits/7989020420f8354b9f6c1597d68c06acddab63d8/sdk/spring/azure-spring-boot-starter-keyvault-certificates/src/main/java/com/azure/spring/security/keyvault/certificates/starter/KeyVaultProperties.java

  1. If customer use azure-security-keyvault-jca, this already written in changelog:

Refs: https://github.com/Azure/azure-sdk-for-java/blob/7989020420f8354b9f6c1597d68c06acddab63d8/sdk/keyvault/azure-security-keyvault-jca/CHANGELOG.md#breaking-changes

@@ -27,11 +27,6 @@
@Override
public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {

if (environment.getProperty("azure.keyvault.uri") == null) {
Copy link
Member

Choose a reason for hiding this comment

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

is there any side effect with this remove?

Copy link
Author

Choose a reason for hiding this comment

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

No side effect, I think.

@chenrujun chenrujun merged commit 3921af0 into Azure:main Jun 29, 2021
@chenrujun chenrujun deleted the make-KeyVaultJcaProvider-can-work-when-keyvault-uri-is-not-set-for-starter-module branch June 29, 2021 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
azure-spring All azure-spring related issues KeyVault
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants