class WhitelistSubscriber implements EventSubscriberInterface

The WhitelistSubscriber listens to API requests and matches them against a whitelist of allowed API calls. If an API call does NOT appear in the whitelist, then it generates an error.

Properties

protected array $rules Array(WhitelistRule).
protected array $activeRules Array (scalar $reqId => WhitelistRule $rule).

Methods

static array
getSubscribedEvents()

No description

__construct(array $rules)

No description

onApiAuthorize( $event)

Determine which, if any, whitelist rules apply this request.

onApiRespond( $event)

Apply any filtering rules based on the chosen whitelist rule.

Details

at line 48
static array getSubscribedEvents()

Return Value

array

at line 75
__construct(array $rules)

Parameters

array $rules Array of WhitelistRule.

Exceptions

CRM_Core_Exception

See also

WhitelistRule

at line 95
onApiAuthorize( $event)

Determine which, if any, whitelist rules apply this request.

Reject unauthorized requests.

Parameters

$event

Exceptions

CRM_Core_Exception

at line 113
onApiRespond( $event)

Apply any filtering rules based on the chosen whitelist rule.

Parameters

$event