Package org.bremersee.security
Class IpAddressMatcher
- java.lang.Object
-
- org.bremersee.security.IpAddressMatcher
-
- Direct Known Subclasses:
ReactiveIpAddressMatcher
public class IpAddressMatcher extends Object
Matches a request based on IP Address or subnet mask matching against the remote address.Both IPv6 and IPv4 addresses are supported, but a matcher which is configured with an IPv4 address will never match a request which returns an IPv6 address, and vice-versa.
The original Spring
org.springframework.security.web.util.matcher.IpAddressMatcher
importsjavax.servlet.http.HttpServletRequest
, that is not available in a reactive environment. Here is the methodboolean matches(HttpServletRequest request)
skipped and ths class does not implementsorg.springframework.security.web.util.matcher.RequestMatcher
,- Author:
- Luke Taylor
-
-
Constructor Summary
Constructors Constructor Description IpAddressMatcher(String ipAddress)
Takes a specific IP address or a range specified using the IP/Netmask (e.g. 192.168.1.0/24 or 202.24.0.0/14).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
matches(String address)
Matches an IPv6 and IPv4 address.
-
-
-
Constructor Detail
-
IpAddressMatcher
public IpAddressMatcher(String ipAddress)
Takes a specific IP address or a range specified using the IP/Netmask (e.g. 192.168.1.0/24 or 202.24.0.0/14).- Parameters:
ipAddress
- the address or range of addresses from which the request must come.
-
-
Method Detail
-
matches
public boolean matches(String address)
Matches an IPv6 and IPv4 address.- Parameters:
address
- the address- Returns:
- the
true
id the given address matches an IPv6 and IPv4 address, otherwisefalse
-
-