@Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,
            ServletException {
        DefaultSecurityContext.setServletRequest((HttpServletRequest) request);
        try {
            chain.doFilter(request, response);
        } finally {
            DefaultSecurityContext.clearServletRequest();
            DefaultSecurityContext.clearPermissions();
        }
    }
@see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)
manager/api/security/src/main/java/io/apiman/manager/api/security/impl/DefaultSecurityContextFilter.java