You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by "fuweng11 (via GitHub)" <gi...@apache.org> on 2023/07/01 16:06:31 UTC

[GitHub] [inlong] fuweng11 commented on a diff in pull request #8390: [INLONG-8389][Manager] Fix the tenant interception failure when authentication is disable

fuweng11 commented on code in PR #8390:
URL: https://github.com/apache/inlong/pull/8390#discussion_r1248885213


##########
inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/auth/tenant/TenantAuthenticatingFilter.java:
##########
@@ -48,23 +55,24 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
         HttpServletRequest httpServletRequest = (HttpServletRequest) request;
         Subject subject = SecurityUtils.getSubject();
 
+        UserInfo loginUserInfo;
         // pre-check
         if (!subject.isAuthenticated()) {
-            log.error("The request should be authed before tenant authentication, user:{}, path:{}",
-                    subject.getPrincipal(),
-                    httpServletRequest.getServletPath());
-            ((HttpServletResponse) response).sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-            return;
+            log.debug("the request is not authed before tenant authentication, use default user:{}, path:{}",
+                    DEFAULT_USER, httpServletRequest.getServletPath());
+            loginUserInfo = defaultUserInfo();

Review Comment:
   I think it's only necessary to set a default user when OpenAPI authentication is not enabled.



-- 
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: commits-unsubscribe@inlong.apache.org

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