Class InetAddressMatchers
java.lang.Object
org.springframework.security.web.util.matcher.InetAddressMatchers
Factory for creating
InetAddressMatcher instances with various matching
strategies for IP addresses.- Since:
- 7.1
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA builder for constructingInetAddressMatcherinstances with various matching rules. -
Method Summary
Modifier and TypeMethodDescriptionstatic InetAddressMatchers.Builderbuilder()Creates a new builder for configuring anInetAddressMatcher.static InetAddressMatchers.BuilderCreates a new builder configured to match external (non-private) IP addresses.static InetAddressMatchers.BuilderCreates a new builder configured to match internal (private) IP addresses.
-
Method Details
-
builder
Creates a new builder for configuring anInetAddressMatcher.- Returns:
- a new
InetAddressMatchers.Builderinstance
-
matchExternal
Creates a new builder configured to match external (non-private) IP addresses.- Returns:
- a
InetAddressMatchers.Builderconfigured to match external addresses
-
matchInternal
Creates a new builder configured to match internal (private) IP addresses.Internal addresses include loopback addresses (127.0.0.0/8 for IPv4, ::1 for IPv6), private IPv4 address ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), and IPv6 Unique Local Addresses (fc00::/7).
- Returns:
- a
InetAddressMatchers.Builderconfigured to match internal addresses
-