pareshddevalia commented on code in PR #397:
URL: https://github.com/apache/atlas/pull/397#discussion_r2218244878


##########
webapp/src/main/java/org/apache/atlas/web/filters/AtlasKnoxSSOAuthenticationFilter.java:
##########
@@ -163,17 +171,12 @@ public void init(FilterConfig filterConfig) throws 
ServletException {
      */
     @Override
     public void doFilter(ServletRequest servletRequest, ServletResponse 
servletResponse, FilterChain filterChain) throws IOException, ServletException {
+        setSsoEnabled(false);
         HttpServletResponse         httpResponse    = (HttpServletResponse) 
servletResponse;

Review Comment:
   Duplciate httpsResponse in doFilter function



##########
webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java:
##########
@@ -1098,6 +1101,14 @@ public Response serviceReadiness() throws 
AtlasBaseException {
         }
     }
 
+    @GET
+    @Path("/checksso")
+    @Produces(MediaType.TEXT_PLAIN)
+    public String checkSSO() {
+        LOG.debug("SSO Details: {}", 
atlasKnoxSSOAuthenticationFilter.isSsoEnabled());

Review Comment:
   You're directly injecting the AtlasKnoxSSOAuthenticationFilter into 
AdminResource. As filters are servlet-managed rather than Spring-managed 
   
   Suggestion:
   If you want to track SSO across requests or sessions, consider storing the 
flag: In HttpSession



##########
webapp/src/main/java/org/apache/atlas/web/filters/AtlasKnoxSSOAuthenticationFilter.java:
##########
@@ -187,12 +190,6 @@ public void doFilter(ServletRequest servletRequest, 
ServletResponse servletRespo
             return;
         }
 
-        if (jwtProperties == null || isAuthenticated()) {
-            filterChain.doFilter(servletRequest, servletResponse);
-
-            return;
-        }
-
         if (LOG.isDebugEnabled()) {

Review Comment:
   Remove this if (LOG.isDebugEnabled()) { condition, This check avoids the 
overhead of the debug message



-- 
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-unsubscr...@atlas.apache.org

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

Reply via email to