Class AutoBasicAuthFilter

  • All Implemented Interfaces:
    org.littleshoot.proxy.HttpFilters

    public class AutoBasicAuthFilter
    extends HttpsAwareFiltersAdapter
    A filter that adds Basic authentication information to non-CONNECT requests. Takes a map of domain names to base64-encoded Basic auth credentials as a constructor parameter. If a key in the map matches the hostname of a filtered request, an Authorization header will be added to the request. The Authorization header itself is specified in RFC 7235, section 4.2: https://tools.ietf.org/html/rfc7235#section-4.2 The Basic authentication scheme is specified in RFC 2617, section 2: https://tools.ietf.org/html/rfc2617#section-2
    • Constructor Summary

      Constructors 
      Constructor Description
      AutoBasicAuthFilter​(io.netty.handler.codec.http.HttpRequest originalRequest, io.netty.channel.ChannelHandlerContext ctx, java.util.Map<java.lang.String,​java.lang.String> credentialsByHostname)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      io.netty.handler.codec.http.HttpResponse clientToProxyRequest​(io.netty.handler.codec.http.HttpObject httpObject)  
      • Methods inherited from class org.littleshoot.proxy.HttpFiltersAdapter

        proxyToClientResponse, proxyToServerConnectionFailed, proxyToServerConnectionQueued, proxyToServerConnectionSSLHandshakeStarted, proxyToServerConnectionStarted, proxyToServerConnectionSucceeded, proxyToServerRequest, proxyToServerRequestSending, proxyToServerRequestSent, proxyToServerResolutionFailed, proxyToServerResolutionStarted, proxyToServerResolutionSucceeded, serverToProxyResponse, serverToProxyResponseReceived, serverToProxyResponseReceiving, serverToProxyResponseTimedOut
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AutoBasicAuthFilter

        public AutoBasicAuthFilter​(io.netty.handler.codec.http.HttpRequest originalRequest,
                                   io.netty.channel.ChannelHandlerContext ctx,
                                   java.util.Map<java.lang.String,​java.lang.String> credentialsByHostname)
    • Method Detail

      • clientToProxyRequest

        public io.netty.handler.codec.http.HttpResponse clientToProxyRequest​(io.netty.handler.codec.http.HttpObject httpObject)
        Specified by:
        clientToProxyRequest in interface org.littleshoot.proxy.HttpFilters
        Overrides:
        clientToProxyRequest in class org.littleshoot.proxy.HttpFiltersAdapter