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



##########
File path: 
gateway-provider-security-jwt/src/main/java/org/apache/knox/gateway/provider/federation/jwt/filter/JWTFederationFilter.java
##########
@@ -186,4 +215,46 @@ protected void handleValidationError(HttpServletRequest 
request, HttpServletResp
     }
   }
 
+  /**
+   * A helper method that checks whether request contains
+   * unauthenticated path
+   * @param request
+   * @return
+   */
+  private boolean doesRequestContainUnauthPath(final ServletRequest request) {
+    for (final String path : unAuthenticatedPaths) {
+      if (((HttpServletRequest) request).getPathInfo().equals(path)) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  /**
+   * A function that let's configured unauthenticated path requests to
+   * pass through without requiring authentication.
+   * An anonymous subject is created and the request is audited.
+   *
+   * Fail gracefully by logging error message.
+   * @param request
+   * @param response
+   * @param chain
+   */
+  private void checkForUnauthenticatedPaths(final ServletRequest request,

Review comment:
       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.

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


Reply via email to