urunni88 commented on code in PR #30151:
URL: https://github.com/apache/camel/pull/30151#discussion_r4585054130
##########
components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/authentication/JWTAuthenticationConfigurer.java:
##########
@@ -112,6 +136,57 @@ public <T extends AuthenticationProvider>
AuthenticationHandler createAuthentica
authenticationConfig.setEnabled(true);
}
+ /**
+ * Vert.x only uses the keys whose alias is the name of a JWT algorithm,
such as RS256. A keystore without such an
+ * alias loads fine, but then every signed token fails, so warn at startup.
+ */
+ private static void warnIfNoJwtAlias(String type, String path, String
password, String configPrefix) {
+ if (path == null) {
+ return;
+ }
+ try (InputStream is = openKeystore(path)) {
+ if (is == null) {
+ // Vert.x reports a keystore it cannot read
+ return;
+ }
+ KeyStore keyStore = KeyStore.getInstance(type);
+ keyStore.load(is, password != null ? password.toCharArray() :
null);
Review Comment:
Done in 9a776e4: `KeyStore.getDefaultType()` is used when no type is set,
and a keystore that cannot be loaded now fails the startup instead of being
logged at DEBUG.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]