Class TrustedProxyManagerImpl
java.lang.Object
com.atlassian.crowd.manager.proxy.TrustedProxyManagerImpl
- All Implemented Interfaces:
TrustedProxyManager
Handles the list of proxy servers whose X-Forwarded-For headers we trust. Deals with persisting and querying the list.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTrustedProxyManagerImpl(PropertyManager propertyManager, com.atlassian.cache.Cache<String, Boolean> cache, ClusterMessageService clusterMessageService) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddAddress(String remoteAddress) Adds to the list of servers we trust.Returns the addresses of the trusted proxy servers, or an empty set if there are none.booleanReturnstrue</tt> if the proxy server is trusted, <tt>falseotherwise.voidvoidremoveAddress(String remoteAddress) Removes from the list of trusted servers.void
-
Field Details
-
REQUESTED_PROXIES_CACHE
-
-
Constructor Details
-
TrustedProxyManagerImpl
public TrustedProxyManagerImpl(PropertyManager propertyManager, com.atlassian.cache.Cache<String, Boolean> cache, ClusterMessageService clusterMessageService)
-
-
Method Details
-
registerListeners
@PostConstruct public void registerListeners() -
unregisterListeners
@PreDestroy public void unregisterListeners() -
isTrusted
Returnstrue</tt> if the proxy server is trusted, <tt>falseotherwise.- Specified by:
isTrustedin interfaceTrustedProxyManager- Parameters:
remoteAddress- address of the proxy- Returns:
trueif the remote address is a trusted proxy
-
getAddresses
Returns the addresses of the trusted proxy servers, or an empty set if there are none. Loads the addresses using the PropertyManager.- Specified by:
getAddressesin interfaceTrustedProxyManager- Returns:
- addresses of the trusted proxies
-
addAddress
Adds to the list of servers we trust. Pass an IP address in decimal dot format (eg. 192.168.3.2) Allows IP addresses with subnets as well (eg. 192.168.3.0/24)- Specified by:
addAddressin interfaceTrustedProxyManager- Parameters:
remoteAddress- host name or IP address- Returns:
- true if the addition was successful, false otherwise
-
removeAddress
Removes from the list of trusted servers.- Specified by:
removeAddressin interfaceTrustedProxyManager- Parameters:
remoteAddress- hostname or IP address
-