You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by "healchow (via GitHub)" <gi...@apache.org> on 2023/07/01 15:16:22 UTC
[GitHub] [inlong] healchow commented on a diff in pull request #8390: [INLONG-8389][Manager] Fix the tenant interception failure when authentication is disable
healchow commented on code in PR #8390:
URL: https://github.com/apache/inlong/pull/8390#discussion_r1248868661
##########
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:
Will it exist that when authentication is enabled, the user is not logged, and finally the default user info is set here by mistake?
--
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