You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by GitBox <gi...@apache.org> on 2022/01/18 14:47:39 UTC

[GitHub] [knox] moresandeep commented on a change in pull request #532: KNOX-2703 - Configuring JWT type at creation/verification time

moresandeep commented on a change in pull request #532:
URL: https://github.com/apache/knox/pull/532#discussion_r786819698



##########
File path: gateway-provider-security-jwt/src/main/java/org/apache/knox/gateway/provider/federation/jwt/filter/JWTFederationFilter.java
##########
@@ -90,6 +94,14 @@ public void init( FilterConfig filterConfig ) throws ServletException {
       expectedJWKSUrl = oidcjwksurl;
     }
 
+    allowedJwsTypes = new HashSet<>();
+    final String allowedTypes = filterConfig.getInitParameter(ALLOWED_JWS_TYPES);
+    if (allowedTypes != null) {
+      Stream.of(allowedTypes.trim().split(",", -1)).forEach(allowedType -> allowedJwsTypes.add(new JOSEObjectType(allowedType.trim())));

Review comment:
       nit, -1 limit for split appears redundant.




-- 
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: dev-unsubscribe@knox.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org