Package io.helidon.microprofile.security
Class SecurityFilter
java.lang.Object
io.helidon.microprofile.security.SecurityFilter
- All Implemented Interfaces:
ContainerRequestFilter
,ContainerResponseFilter
@Priority(1000)
@ConstrainedTo(SERVER)
public class SecurityFilter
extends Object
implements ContainerRequestFilter, ContainerResponseFilter
A filter that handles authentication and authorization.
-
Constructor Summary
ConstructorDescriptionSecurityFilter
(Security security, FeatureConfig featureConfig, SecurityContext securityContext) Constructor to be used by Jersey when creating an instance, injects all parameters. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
abortRequest
(SecurityFilterContext context, SecurityResponse response, int defaultStatusCode, Map<String, List<String>> defaultHeaders) protected void
authenticate
(SecurityFilterContext context, SecurityContext securityContext, AtnTracing atnTracing) protected void
authorize
(SecurityFilterContext context, SecurityContext securityContext, AtzTracing atzTracing) protected SecurityFilterContext
configureContext
(SecurityFilterContext context, ContainerRequestContext requestContext, UriInfo uriInfo) protected void
doFilter
(ContainerRequestContext request, SecurityContext securityContext) protected FeatureConfig
void
filter
(ContainerRequestContext request) void
filter
(ContainerRequestContext requestContext, ContainerResponseContext responseContext) protected SecurityFilterContext
initRequestFiltering
(ContainerRequestContext requestContext) protected System.Logger
logger()
void
A life-cycle method invoked by Jersey that finished initialization of the filter.protected void
processAuthentication
(SecurityFilterContext context, SecurityClientBuilder<AuthenticationResponse> clientBuilder, io.helidon.microprofile.security.SecurityDefinition methodSecurity, AtnTracing atnTracing) protected void
processAuthorization
(SecurityFilterContext context, SecurityClientBuilder<AuthorizationResponse> clientBuilder) protected void
processSecurity
(ContainerRequestContext request, SecurityFilterContext filterContext, SecurityTracing tracing, SecurityContext securityContext) protected Security
security()
protected void
updateHeaders
(Map<String, List<String>> responseHeaders, Response.ResponseBuilder responseBuilder)
-
Constructor Details
-
SecurityFilter
public SecurityFilter(@Context Security security, @Context FeatureConfig featureConfig, @Context SecurityContext securityContext) Constructor to be used by Jersey when creating an instance, injects all parameters.- Parameters:
security
- security instancefeatureConfig
- feature configsecurityContext
- security context
-
-
Method Details
-
postConstruct
@PostConstruct public void postConstruct()A life-cycle method invoked by Jersey that finished initialization of the filter. -
filter
- Specified by:
filter
in interfaceContainerRequestFilter
-
processSecurity
protected void processSecurity(ContainerRequestContext request, SecurityFilterContext filterContext, SecurityTracing tracing, SecurityContext securityContext) -
filter
public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) - Specified by:
filter
in interfaceContainerResponseFilter
-
initRequestFiltering
-
logger
-
doFilter
-
authenticate
protected void authenticate(SecurityFilterContext context, SecurityContext securityContext, AtnTracing atnTracing) -
processAuthentication
protected void processAuthentication(SecurityFilterContext context, SecurityClientBuilder<AuthenticationResponse> clientBuilder, io.helidon.microprofile.security.SecurityDefinition methodSecurity, AtnTracing atnTracing) -
authorize
protected void authorize(SecurityFilterContext context, SecurityContext securityContext, AtzTracing atzTracing) -
processAuthorization
protected void processAuthorization(SecurityFilterContext context, SecurityClientBuilder<AuthorizationResponse> clientBuilder) -
abortRequest
protected void abortRequest(SecurityFilterContext context, SecurityResponse response, int defaultStatusCode, Map<String, List<String>> defaultHeaders) -
updateHeaders
protected void updateHeaders(Map<String, List<String>> responseHeaders, Response.ResponseBuilder responseBuilder) -
configureContext
protected SecurityFilterContext configureContext(SecurityFilterContext context, ContainerRequestContext requestContext, UriInfo uriInfo) -
security
-
featureConfig
-