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



##########
File path: 
gateway-spi/src/main/java/org/apache/knox/gateway/services/security/token/impl/JWTToken.java
##########
@@ -122,6 +129,10 @@ public JWTToken(String alg, String[] claimsArray, 
List<String> audiences, boolea
     jwt = new SignedJWT(header, claims);
   }
 
+  private String getClaimValue(String[] claims, int index) {
+    return claims == null || claims.length < index ? null : claims[index];

Review comment:
       Nice catch! Fixed :)

##########
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:
       Nice catch! Fixed :)




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