@PublicApi @Deprecated public interface

WhitelistService

com.atlassian.jira.bc.whitelist.WhitelistService
Known Indirect Subclasses

This interface is deprecated.
Replaced by com.atlassian.plugins.whitelist.WhitelistService and com.atlassian.plugins.whitelist.OutboundWhitelist. Since v6.1.

@PublicApi

This interface is designed for plugins to consume (call its methods).

Clients of @PublicApi can expect that programs compiled against a given version will remain binary compatible with later versions of the @PublicApi as per each product's API policy as long as the client does not implement/extend @PublicApi interfaces or classes (refer to each product's API policy for the exact guarantee---usually binary compatibility is guaranteed at least across minor versions).

Note: since @PublicApi interfaces and classes are not designed to be implemented or extended by clients, we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces annotated with @PublicSpi are safe to extend/implement).

Class Overview

Service to control whitelist rules currently used for allowing which http requests gadgets are allowed to make. This can be used in future to whitelist any http requests! Only system administrators should be allowed to modify the whitelist implemenation

Summary

Nested Classes
class WhitelistService.WhitelistResult  
class WhitelistService.WhitelistUpdateValidationResult  
Public Methods
@Deprecated WhitelistService.WhitelistResult getRules(JiraServiceContext context)
This method is deprecated. Replaced by getAll(). Since v6.1.
@Deprecated boolean isAllowed(URI uri)
This method is deprecated. Replaced by isAllowed(java.net.URI). Since v6.1.
@Deprecated boolean isDisabled()
This method is deprecated. Replaced by isWhitelistEnabled(). Since v6.1.
@Deprecated WhitelistService.WhitelistResult updateRules(WhitelistService.WhitelistUpdateValidationResult result)
@Deprecated WhitelistService.WhitelistUpdateValidationResult validateUpdateRules(JiraServiceContext context, List<String> rules, boolean disabled)

Public Methods

@Deprecated public WhitelistService.WhitelistResult getRules (JiraServiceContext context)

This method is deprecated.
Replaced by getAll(). Since v6.1.

Returns a list of rules that are currently allowed in the whitelist. The list will contain entries like:

  • http://www.atlassian.com/
  • http://www.google.com/*
  • =http://jira.atlassian.com/
  • \/.*www.*\/

Parameters
context The service context with the current user & error collection
Returns
  • Result containing the list of rules or an error message

@Deprecated public boolean isAllowed (URI uri)

This method is deprecated.
Replaced by isAllowed(java.net.URI). Since v6.1.

Checks if requests to the provided URI are allowed according to the current whitelist configuration

Parameters
uri The uri a http request is made to
Returns
  • true if requests are allowed, false otherwise

@Deprecated public boolean isDisabled ()

This method is deprecated.
Replaced by isWhitelistEnabled(). Since v6.1.

Returns true if the whitelist is currently disabled (meaning all requests are allowed).

Returns
  • true if the whitelist is currently disabled (meaning all requests are allowed)

@Deprecated public WhitelistService.WhitelistResult updateRules (WhitelistService.WhitelistUpdateValidationResult result)

This method is deprecated.
Replaced by add(com.atlassian.plugins.whitelist.WhitelistRule), remove(int), disableWhitelist() and enableWhitelist(). Since v6.1.

Takes the validation result from validateUpdateRules(com.atlassian.jira.bc.JiraServiceContext, java.util.List, boolean) and persists the new rules.

Parameters
result a validation result obtained by calling validateUpdateRules(com.atlassian.jira.bc.JiraServiceContext, java.util.List, boolean)
Returns
  • Result containing the newly peristed whitelist

@Deprecated public WhitelistService.WhitelistUpdateValidationResult validateUpdateRules (JiraServiceContext context, List<String> rules, boolean disabled)

This method is deprecated.
Replaced by add(com.atlassian.plugins.whitelist.WhitelistRule), remove(int), disableWhitelist() and enableWhitelist(). Since v6.1.

Validates that the current user is allowed to update the whitelist by checking if they are a system administrator.

Parameters
context The service context with the current user & error collection
rules List of rule strings
disabled true if the whitelist should be turned off
Returns
  • A validation result that can be used to persist the new whitelist rules.