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(AuthorizeEvent $event)

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

onApiRespond(RespondEvent $event)

Apply any filtering rules based on the chosen whitelist rule.

Details

at line 47
static array getSubscribedEvents()

Return Value

array

at line 74
__construct(array $rules)

Parameters

array $rules Array of WhitelistRule.

Exceptions

CRM_Core_Exception

See also

WhitelistRule

at line 94
onApiAuthorize(AuthorizeEvent $event)

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

Reject unauthorized requests.

Parameters

AuthorizeEvent $event

Exceptions

CRM_Core_Exception

at line 112
onApiRespond(RespondEvent $event)

Apply any filtering rules based on the chosen whitelist rule.

Parameters

RespondEvent $event