Package com.redhat.cloud.common.auth
Class IncomingRequestFilter
- java.lang.Object
-
- com.redhat.cloud.common.auth.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. SeeRbacFilterfor this purpose. Usage in code:{@code- Author:
- hrupp
-
-
Constructor Summary
Constructors Constructor Description IncomingRequestFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfilter(javax.ws.rs.container.ContainerRequestContext requestContext)
-
-
-
Method Detail
-
filter
public void filter(javax.ws.rs.container.ContainerRequestContext requestContext) throws IOException- Specified by:
filterin interfacejavax.ws.rs.container.ContainerRequestFilter- Throws:
IOException
-
-