Class IpAddressAuthorizationManager
java.lang.Object
org.springframework.security.web.access.IpAddressAuthorizationManager
- All Implemented Interfaces:
AuthorizationManager<RequestAuthorizationContext>
public final class IpAddressAuthorizationManager
extends Object
implements AuthorizationManager<RequestAuthorizationContext>
A
AuthorizationManager
, that determines if the current request contains the
specified address or range of addresses- Since:
- 6.3
-
Method Summary
Modifier and TypeMethodDescriptionauthorize
(Supplier<? extends @Nullable Authentication> authentication, RequestAuthorizationContext requestAuthorizationContext) Determines if access is granted for a specific authentication and object.hasIpAddress
(String ipAddress) Creates an instance ofIpAddressAuthorizationManager
with the provided IP address.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.security.authorization.AuthorizationManager
verify
-
Method Details
-
hasIpAddress
Creates an instance ofIpAddressAuthorizationManager
with the provided IP address.- Parameters:
ipAddress
- the address or range of addresses from which the request must- Returns:
- the new instance
-
authorize
public AuthorizationResult authorize(Supplier<? extends @Nullable Authentication> authentication, RequestAuthorizationContext requestAuthorizationContext) Description copied from interface:AuthorizationManager
Determines if access is granted for a specific authentication and object.- Specified by:
authorize
in interfaceAuthorizationManager<RequestAuthorizationContext>
- Parameters:
authentication
- theSupplier
of theAuthentication
to authorizerequestAuthorizationContext
- theAuthorizationManager
object to authorize- Returns:
- an
AuthorizationResult
-