-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[BUG] Spring application.properties azure-spring-boot-sample-keyvault-certificates uses camel case. Others use hyphens #17740
Comments
Examples
|
Hello @mnriem here is another question. Even with adjusting for using the hyphenated instead of camel case, I have a question about this property:
Other places use
So might it not be better to do the same for |
@jialindai wrote: Hi Ed, To use data binding, one simple approach is to use @ConfigurationProperties annotation, some explains can be found at: https://www.baeldung.com/configuration-properties-in-spring-boot The underlying API is data binder: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/validation/DataBinder.html It has one bind() API to bind PropertyValues into an object. In general, the @ConfigurationProperties approach is preferred. Regards, |
Hello @jialindai Thanks for your suggestion about using I am unsure if the approach you suggest of using If this is true, I am happy to do the little bit of coding work. RationaleHere is my sketch of the proposed modifications to enable the tolerance
The JCA entry point will still use the single preferred usage of Proposed ModificationsConsider this code, in String aadAuthenticationUrl = environment.getProperty("azure.keyvault.aad-authentication-url");
if (aadAuthenticationUrl != null) {
systemProperties.put("azure.keyvault.aad-authentication-url", aadAuthenticationUrl);
} I propose we use the if (null != certProperties.getAadAuthenticationUrl()) {
systemProperties.put("azure.keyvault.aad-authentication-url", aadAuthenticationUrl);
} with a similar usage for the other properties. I would like comments from @jialindai and @mnriem on this before I proceed. |
@edburns, I think above is a good idea. It makes Spring config file more flexible in property names. |
@edburns Go for it. Make sure you test the variations ;) |
We may want to keep both camel case and hyphen case in system properties, so that we don't break customers using our beta version. |
@jialindai We can keep this closed because I am working on it now in #18273 . |
…18273 property name consistency (#18340) This commit addresses the damage apparently done by the apparently prematurely merged #17741. That PR was seeking conceptual review in the associated issue #17740 (see [this comment](#17740 (comment))). While I received the conceptual review, I had not yet completed the corresponding implementation work. This commit does not complete that work either. However, it does make the system work again, but only with property names that strictly conform to the "hyphens not camel case" syntax. Before this commit, the system did not work at all. After this commit, the system works, but only with the new conforming properties, which means it will break existing customers. I am continuing to work on #18273, which will make the system work without breaking existing customers. modified: sdk/keyvault/azure-security-keyvault-jca/README.md modified: sdk/keyvault/azure-security-keyvault-jca/pom.xml - Several tests were using non-conforming test property names, such as: - System.getProperty("azure.tenant.id"), - System.getProperty("azure.client.id"), - System.getProperty("azure.client.secret")); I changed these to + System.getProperty("azure.keyvault.tenant-id"), + System.getProperty("azure.keyvault.client-id"), + System.getProperty("azure.keyvault.client-secret")); modified: sdk/keyvault/azure-security-keyvault-jca/src/main/java/com/azure/security/keyvault/jca/KeyVaultKeyStore.java - This is where the damage happened. When #17741 was merged, those changes invalidated the contract with this code. This change modifies this side of the contract to conform with that in the existing #17741 change. modified: sdk/keyvault/azure-security-keyvault-jca/src/samples/java/sample/com/azure/security/keyvault/jca/ClientSSLSample.java modified: sdk/keyvault/azure-security-keyvault-jca/src/samples/java/sample/com/azure/security/keyvault/jca/ServerSSLSample.java modified: sdk/keyvault/azure-security-keyvault-jca/src/test/java/com/azure/security/keyvault/jca/AuthClientTest.java modified: sdk/keyvault/azure-security-keyvault-jca/src/test/java/com/azure/security/keyvault/jca/KeyVaultJcaProviderTest.java modified: sdk/keyvault/azure-security-keyvault-jca/src/test/java/com/azure/security/keyvault/jca/KeyVaultKeyStoreTest.java modified: sdk/keyvault/azure-security-keyvault-jca/src/test/java/com/azure/security/keyvault/jca/KeyVaultLoadStoreParameterTest.java modified: sdk/keyvault/azure-security-keyvault-jca/src/test/java/com/azure/security/keyvault/jca/ServerSocketTest.java modified: sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-keyvault-certificates/pom.xml modified: sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-keyvault-certificates/src/main/resources/application.properties - These changes all bring the samples and tests into sync with the new contract.
add xms-ids for RPs (set 5) (Azure#17740)
add xms-ids for RPs (set 5) (Azure#17740)
add xms-ids for RPs (set 5) (Azure#17740)
add xms-ids for RPs (set 5) (Azure#17740)
Describe the bug
Consider
sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-keyvault-certificates/src/main/resources/application.properties
. This file uses camel case for property names, while the other samples use hyphens in the same context.The text was updated successfully, but these errors were encountered: