Class SecurityFilter

java.lang.Object
io.micronaut.security.filters.SecurityFilter
All Implemented Interfaces:
io.micronaut.core.order.Ordered, io.micronaut.http.filter.HttpFilter, io.micronaut.http.filter.HttpServerFilter

@Requires(property="micronaut.security.filter.enabled",notEquals="false",defaultValue="true") @Requires(classes=io.micronaut.http.filter.HttpServerFilter.class) @Filter("${micronaut.security.filter.pattern:/**}") public class SecurityFilter extends Object implements io.micronaut.http.filter.HttpServerFilter
Security Filter.
Since:
1.0
Author:
Sergio del Amo, Graeme Rocher
  • Field Details

    • KEY

      public static final String KEY
    • AUTHENTICATION

      public static final CharSequence AUTHENTICATION
      The attribute used to store the authentication object in the request.
    • REJECTION

      public static final CharSequence REJECTION
      The attribute used to store if the request was rejected and why.
    • TOKEN

      public static final CharSequence TOKEN
      The attribute used to store a valid token in the request.
    • securityRules

      protected final Collection<SecurityRule<io.micronaut.http.HttpRequest<?>>> securityRules
    • authenticationFetchers

      protected final Collection<AuthenticationFetcher<io.micronaut.http.HttpRequest<?>>> authenticationFetchers
    • securityConfiguration

      protected final SecurityConfiguration securityConfiguration
  • Constructor Details

  • Method Details

    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface io.micronaut.core.order.Ordered
    • doFilter

      public org.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<?>> doFilter(io.micronaut.http.HttpRequest<?> request, io.micronaut.http.filter.ServerFilterChain chain)
      Specified by:
      doFilter in interface io.micronaut.http.filter.HttpServerFilter
    • checkRules

      protected org.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<?>> checkRules(io.micronaut.http.HttpRequest<?> request, io.micronaut.http.filter.ServerFilterChain chain, @Nullable @Nullable Authentication authentication)
      Check the security rules against the provided arguments.
      Parameters:
      request - The request
      chain - The server chain
      authentication - The authentication
      Returns:
      A response publisher