Class SecurityFilter

  • All Implemented Interfaces:
    io.micronaut.core.order.Ordered, io.micronaut.http.filter.HttpFilter, io.micronaut.http.filter.HttpServerFilter

    @Singleton
    public class SecurityFilter
    extends java.lang.Object
    implements io.micronaut.http.filter.HttpServerFilter
    This service is not injected as a Micronaut filter, but can be used as the implementation of a Filter in the actual app.
    • Field Summary

      • Fields inherited from interface io.micronaut.core.order.Ordered

        HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
    • Method Summary

      Modifier and Type Method Description
      org.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<?>> doFilter​(io.micronaut.http.HttpRequest<?> request, io.micronaut.http.filter.ServerFilterChain chain)
      Checks the validity of a request's Authorization header and continue processing the filter chain if no error occurs.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface io.micronaut.http.filter.HttpServerFilter

        doFilter
      • Methods inherited from interface io.micronaut.core.order.Ordered

        getOrder
    • Method Detail

      • doFilter

        public org.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<?>> doFilter​(io.micronaut.http.HttpRequest<?> request,
                                                                                                io.micronaut.http.filter.ServerFilterChain chain)
        Checks the validity of a request's Authorization header and continue processing the filter chain if no error occurs.
        Specified by:
        doFilter in interface io.micronaut.http.filter.HttpServerFilter
        Parameters:
        request - the request that must be validated against the security checks
        chain - next filters to process if no error occurs
        Returns:
        an HTTP response