public class DefaultWhitelistService extends Object implements WhitelistService
WhitelistService.WhitelistResult, WhitelistService.WhitelistUpdateValidationResult
Constructor and Description |
---|
DefaultWhitelistService(PermissionManager permissionManager,
WhitelistManager whitelistManager,
I18nHelper.BeanFactory beanFactory) |
Modifier and Type | Method and Description |
---|---|
WhitelistService.WhitelistResult |
getRules(JiraServiceContext context)
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).
|
WhitelistService.WhitelistResult |
updateRules(WhitelistService.WhitelistUpdateValidationResult result)
Takes the validation result from
WhitelistService.validateUpdateRules(com.atlassian.jira.bc.JiraServiceContext,
java.util.List, boolean) and persists the new rules. |
WhitelistService.WhitelistUpdateValidationResult |
validateUpdateRules(JiraServiceContext context,
List<String> rules,
boolean disabled)
Validates that the current user is allowed to update the whitelist by checking if they are a system
administrator.
|
public DefaultWhitelistService(PermissionManager permissionManager, WhitelistManager whitelistManager, I18nHelper.BeanFactory beanFactory)
public WhitelistService.WhitelistResult getRules(JiraServiceContext context)
WhitelistService
getRules
in interface WhitelistService
context
- The service context with the current user & error collectionpublic WhitelistService.WhitelistUpdateValidationResult validateUpdateRules(JiraServiceContext context, List<String> rules, boolean disabled)
WhitelistService
validateUpdateRules
in interface WhitelistService
context
- The service context with the current user & error collectionrules
- List of rule stringsdisabled
- true if the whitelist should be turned offpublic WhitelistService.WhitelistResult updateRules(WhitelistService.WhitelistUpdateValidationResult result)
WhitelistService
WhitelistService.validateUpdateRules(com.atlassian.jira.bc.JiraServiceContext,
java.util.List, boolean)
and persists the new rules.updateRules
in interface WhitelistService
result
- a validation result obtained by calling WhitelistService.validateUpdateRules(com.atlassian.jira.bc.JiraServiceContext,
java.util.List, boolean)
public boolean isDisabled()
WhitelistService
isDisabled
in interface WhitelistService
public boolean isAllowed(URI uri)
WhitelistService
isAllowed
in interface WhitelistService
uri
- The uri a http request is made toCopyright © 2002-2019 Atlassian. All Rights Reserved.