Package io.undertow.server.handlers
Class IPAddressAccessControlHandler
java.lang.Object
io.undertow.server.handlers.IPAddressAccessControlHandler
- All Implemented Interfaces:
HttpHandler
Handler that can accept or reject a request based on the IP address of the remote peer.
- Author:
- Stuart Douglas
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds an allowed peer to the ACL listAdds an denied peer to the ACL listintgetNext()voidhandleRequest(HttpServerExchange exchange) Handle the request.booleansetDefaultAllow(boolean defaultAllow) setNext(HttpHandler next)
-
Constructor Details
-
IPAddressAccessControlHandler
-
IPAddressAccessControlHandler
-
IPAddressAccessControlHandler
public IPAddressAccessControlHandler()
-
-
Method Details
-
handleRequest
Description copied from interface:HttpHandlerHandle the request.- Specified by:
handleRequestin interfaceHttpHandler- Parameters:
exchange- the HTTP request/response exchange- Throws:
Exception
-
getDenyResponseCode
public int getDenyResponseCode() -
isDefaultAllow
public boolean isDefaultAllow() -
setDefaultAllow
-
getNext
-
setNext
-
addAllow
Adds an allowed peer to the ACL listPeer can take several forms:
a.b.c.d = Literal IPv4 Address a:b:c:d:e:f:g:h = Literal IPv6 Address a.b.* = Wildcard IPv4 Address a:b:* = Wildcard IPv6 Address a.b.c.0/24 = Classless wildcard IPv4 address a:b:c:d:e:f:g:0/120 = Classless wildcard IPv4 address
- Parameters:
peer- The peer to add to the ACL
-
addDeny
Adds an denied peer to the ACL listPeer can take several forms:
a.b.c.d = Literal IPv4 Address a:b:c:d:e:f:g:h = Literal IPv6 Address a.b.* = Wildcard IPv4 Address a:b:* = Wildcard IPv6 Address a.b.c.0/24 = Classless wildcard IPv4 address a:b:c:d:e:f:g:0/120 = Classless wildcard IPv4 address
- Parameters:
peer- The peer to add to the ACL
-
clearRules
-