Class IncomingRequestFilter

  • All Implemented Interfaces:
    javax.ws.rs.container.ContainerRequestFilter

    @PreMatching
    @Provider
    public class IncomingRequestFilter
    extends Object
    implements javax.ws.rs.container.ContainerRequestFilter
    Request filter. This runs on all incoming requests before method matching and reads the x-rh-identity header. If that is not present, calls will aborted with a "401 unauthorised" response. If the header is present and valid, we produce a {Principal} and inject that into the call chain via {SecurityContext}. The principal will also be made available for Injection, so that you can write in your code. We don't yet query for RBAC here, as this filter is not part of the tracing span, so we would not be able to trace the rbac calls. See RbacFilter for this purpose. Usage in code:
    {@code
    Author:
    hrupp
    • Constructor Detail

      • IncomingRequestFilter

        public IncomingRequestFilter()
    • Method Detail

      • filter

        public void filter​(javax.ws.rs.container.ContainerRequestContext requestContext)
                    throws IOException
        Specified by:
        filter in interface javax.ws.rs.container.ContainerRequestFilter
        Throws:
        IOException