@Component public class DefaultWhitelistManager extends Object implements InternalWhitelistManager, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
Constructor and Description |
---|
DefaultWhitelistManager(com.atlassian.event.api.EventPublisher eventPublisher,
com.atlassian.plugins.whitelist.WhitelistService whitelistService,
com.atlassian.plugins.whitelist.OutboundWhitelist whitelist) |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
void |
destroy() |
List<String> |
getRules()
Returns a list of rules that are currently allowed in the whitelist.
|
boolean |
isAllowed(URI uri)
Checks if requests to the provided URI are allowed according to the current whitelist configuration
|
boolean |
isDisabled() |
void |
onAddGadget(com.atlassian.gadgets.event.AddGadgetEvent addGadgetEvent) |
void |
onAddGadgetFeed(com.atlassian.gadgets.event.AddGadgetFeedEvent addGadgetFeedEvent) |
List<String> |
updateRules(List<String> newRules,
boolean disabled)
Used to update the whitelist configuration.
|
@Autowired public DefaultWhitelistManager(com.atlassian.event.api.EventPublisher eventPublisher, com.atlassian.plugins.whitelist.WhitelistService whitelistService, com.atlassian.plugins.whitelist.OutboundWhitelist whitelist)
public List<String> getRules()
InternalWhitelistManager
getRules
in interface InternalWhitelistManager
public boolean isDisabled()
isDisabled
in interface InternalWhitelistManager
public List<String> updateRules(List<String> newRules, boolean disabled)
InternalWhitelistManager
The method then returns the peristed rules
updateRules
in interface InternalWhitelistManager
newRules
- List of rules to persistdisabled
- True if the whitelist should be switched offpublic boolean isAllowed(URI uri)
InternalWhitelistManager
isAllowed
in interface InternalWhitelistManager
uri
- The uri a http request is made topublic void afterPropertiesSet()
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
public void destroy()
destroy
in interface org.springframework.beans.factory.DisposableBean
@EventListener public void onAddGadget(com.atlassian.gadgets.event.AddGadgetEvent addGadgetEvent)
@EventListener public void onAddGadgetFeed(com.atlassian.gadgets.event.AddGadgetFeedEvent addGadgetFeedEvent)
Copyright © 2002-2022 Atlassian. All Rights Reserved.