Class InetAccessHandler

  • All Implemented Interfaces:
    Handler, HandlerContainer, org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.LifeCycle

    public class InetAccessHandler
    extends HandlerWrapper
    InetAddress Access Handler

    Controls access to the wrapped handler using the real remote IP. Control is provided by and IncludeExcludeSet over a InetAddressSet. This handler uses the real internet address of the connection, not one reported in the forwarded for headers, as this cannot be as easily forged.

    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container

        org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

        org.eclipse.jetty.util.component.LifeCycle.Listener
    • Field Summary

      • Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
      • Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

        KEY
    • Constructor Detail

      • InetAccessHandler

        public InetAccessHandler()
    • Method Detail

      • include

        public void include​(String pattern)
        Includes an InetAddress pattern
        Parameters:
        pattern - InetAddress pattern to include
        See Also:
        InetAddressSet
      • include

        public void include​(String... patterns)
        Includes InetAddress patterns
        Parameters:
        patterns - InetAddress patterns to include
        See Also:
        InetAddressSet
      • exclude

        public void exclude​(String pattern)
        Excludes an InetAddress pattern
        Parameters:
        pattern - InetAddress pattern to exclude
        See Also:
        InetAddressSet
      • exclude

        public void exclude​(String... patterns)
        Excludes InetAddress patterns
        Parameters:
        patterns - InetAddress patterns to exclude
        See Also:
        InetAddressSet
      • isAllowed

        protected boolean isAllowed​(InetAddress address,
                                    HttpServletRequest request)
        Checks if specified address and request are allowed by current InetAddress rules.
        Parameters:
        address - the inetAddress to check
        request - the request to check
        Returns:
        true if inetAddress and request are allowed
      • dump

        public void dump​(Appendable out,
                         String indent)
                  throws IOException
        Specified by:
        dump in interface org.eclipse.jetty.util.component.Dumpable
        Overrides:
        dump in class org.eclipse.jetty.util.component.ContainerLifeCycle
        Throws:
        IOException