|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.jira.bc.whitelist.DefaultWhitelistManager
public class DefaultWhitelistManager
Default implementation that persists the whitelist in applicationproperties
| Field Summary | |
|---|---|
static String |
NO_WILDCARDS_PREFIX
|
static String |
REGEX_PREFIX
|
| Constructor Summary | |
|---|---|
DefaultWhitelistManager(ApplicationProperties applicationProperties,
com.atlassian.event.api.EventPublisher eventPublisher)
|
|
| Method Summary | |
|---|---|
protected String |
createRegex(String rule)
|
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()
Returns true if the whitelist is currently disabled (meaning all requests are allowed). |
void |
onAddGadget(com.atlassian.gadgets.event.AddGadgetEvent addGadgetEvent)
|
void |
onAddGadgetFeed(com.atlassian.gadgets.event.AddGadgetFeedEvent addGadgetFeedEvent)
|
void |
onClearCache(ClearCacheEvent event)
|
void |
start()
This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework. |
List<String> |
updateRules(List<String> newRules,
boolean disabled)
Used to update the whitelist configuration. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String NO_WILDCARDS_PREFIX
public static final String REGEX_PREFIX
| Constructor Detail |
|---|
public DefaultWhitelistManager(ApplicationProperties applicationProperties,
com.atlassian.event.api.EventPublisher eventPublisher)
| Method Detail |
|---|
public List<String> getRules()
WhitelistManager
getRules in interface WhitelistManagerpublic boolean isDisabled()
WhitelistManager
isDisabled in interface WhitelistManager
public List<String> updateRules(List<String> newRules,
boolean disabled)
WhitelistManager
updateRules in interface WhitelistManagernewRules - List of rules to persistdisabled - True if the whitelist should be switched off
public boolean isAllowed(URI uri)
WhitelistManager
isAllowed in interface WhitelistManageruri - The uri a http request is made to
protected String createRegex(String rule)
@EventListener public void onAddGadget(com.atlassian.gadgets.event.AddGadgetEvent addGadgetEvent)
@EventListener public void onAddGadgetFeed(com.atlassian.gadgets.event.AddGadgetFeedEvent addGadgetFeedEvent)
@EventListener public void onClearCache(ClearCacheEvent event)
public void start()
throws Exception
Startable
start in interface StartableException - Allows implementations to throw an Exception.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||