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)
WhitelistServicegetRules in interface WhitelistServicecontext - The service context with the current user & error collectionpublic WhitelistService.WhitelistUpdateValidationResult validateUpdateRules(JiraServiceContext context, List<String> rules, boolean disabled)
WhitelistServicevalidateUpdateRules in interface WhitelistServicecontext - 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)
WhitelistServiceWhitelistService.validateUpdateRules(com.atlassian.jira.bc.JiraServiceContext,
java.util.List, boolean) and persists the new rules.updateRules in interface WhitelistServiceresult - a validation result obtained by calling WhitelistService.validateUpdateRules(com.atlassian.jira.bc.JiraServiceContext,
java.util.List, boolean)public boolean isDisabled()
WhitelistServiceisDisabled in interface WhitelistServicepublic boolean isAllowed(URI uri)
WhitelistServiceisAllowed in interface WhitelistServiceuri - The uri a http request is made toCopyright © 2002-2022 Atlassian. All Rights Reserved.