@Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
            throws IOException, ServletException {
        HttpServletRequest request = (HttpServletRequest) servletRequest;
        String tenant = request.getHeader(BASIC_AUTH_TENANT_HEADER);
        if (StringUtils.isBlank(tenant)) {
            String errMsg = "tenant should not be blank";
            log.error(errMsg);
            ((HttpServletResponse) servletResponse).sendError(HttpServletResponse.SC_BAD_REQUEST, errMsg);
            return;
        }

        InlongRequestWrapper inlongWrapper;
        if (request instanceof ShiroHttpServletRequest) {
            ShiroHttpServletRequest shiroWrapper = (ShiroHttpServletRequest) request;
            inlongWrapper = (InlongRequestWrapper) shiroWrapper.getRequest();
        } else if (request instanceof InlongRequestWrapper) {
            inlongWrapper = (InlongRequestWrapper) request;
        } else {
            String errMsg = "request should be one of ShiroHttpServletRequest or InlongRequestWrapper type";
            log.error(errMsg);
            ((HttpServletResponse) servletResponse).sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, errMsg);
            return;
        }

        inlongWrapper.addParameter(BASIC_AUTH_TENANT_HEADER, tenant);
        filterChain.doFilter(inlongWrapper, servletResponse);

    }
Tenant info insertion filter.
Add tenant into param and body of each request
inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/filter/TenantInsertionFilter.java