urunni88 commented on code in PR #30151:
URL: https://github.com/apache/camel/pull/30151#discussion_r4583530091


##########
components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/authentication/JWTAuthenticationConfigurer.java:
##########
@@ -112,6 +135,52 @@ 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) {
+        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);
+            String warning = checkJwtKeystoreAliases(keyStore, configPrefix);

Review Comment:
   Thanks, done: the warning now starts with the keystore path, followed by the 
property name, and the test checks it.



-- 
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]

Reply via email to