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



##########
File path: 
gateway-provider-security-jwt/src/main/java/org/apache/knox/gateway/provider/federation/jwt/filter/AbstractJWTFilter.java
##########
@@ -342,7 +376,34 @@ protected boolean validateToken(HttpServletRequest 
request, HttpServletResponse
     return false;
   }
 
-  protected boolean verifyTokenSignature(final JWT token) {
+  protected boolean validateToken(final HttpServletRequest request,
+                                  final HttpServletResponse response,
+                                  final FilterChain chain,
+                                  final String tokenId)
+          throws IOException, ServletException {
+
+    if (tokenStateService != null) {
+      try {
+//        TokenMetadata metadata = tokenStateService.getTokenMetadata(tokenId);

Review comment:
       nit: can loose the comments here if you revisit this.

##########
File path: 
gateway-provider-security-hadoopauth/src/main/java/org/apache/knox/gateway/hadoopauth/filter/HadoopAuthPostFilter.java
##########
@@ -78,7 +79,14 @@ public void doFilter(ServletRequest request, ServletResponse 
response, FilterCha
     Subject subject = null;
     if (shouldUseJwtFilter(jwtFilter, (HttpServletRequest) request)) {
       try {
-        subject = 
jwtFilter.createSubjectFromToken(jwtFilter.getWireToken(request));
+        Pair<JWTFederationFilter.TokenType, String> wireToken = 
jwtFilter.getWireToken(request);
+        JWTFederationFilter.TokenType tokenType = wireToken.getLeft();
+        String token = wireToken.getRight();
+        if (JWTFederationFilter.TokenType.JWT.equals(tokenType)) {
+          subject = jwtFilter.createSubjectFromToken(token);
+        } else if (JWTFederationFilter.TokenType.Passcode.equals(tokenType)) {

Review comment:
       nit: this could be just 
`JWTFederationFilter.TokenType.PASSCODE.equals(tokenType)` for readability.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to