protected function Client::buildAuthenticator in Acquia Connector 3.x
Same name and namespace in other branches
- 8.2 src/Client.php \Drupal\acquia_connector\Client::buildAuthenticator()
- 8 src/Client.php \Drupal\acquia_connector\Client::buildAuthenticator()
Build authenticator to sign requests to the Acquia.
Parameters
string $key: Secret key to use for signing the request.
int $request_time: Such as from \Drupal::time()->getRequestTime().
array $params: Optional parameters to include. 'identifier' - Network Identifier.
Return value
array Authenticator array.
3 calls to Client::buildAuthenticator()
- Client::getSubscriptionCredentials in src/
Client.php - Get account settings to use for creating request authorizations.
- Client::nspiCall in src/
Client.php - Prepare and send a REST request to Acquia with an authenticator.
- ClientTest::buildAuthenticator in tests/
src/ Unit/ AcquiaConnectorUnitTest.php - Build authenticator to sign requests to the Acquia.
1 method overrides Client::buildAuthenticator()
- ClientTest::buildAuthenticator in tests/
src/ Unit/ AcquiaConnectorUnitTest.php - Build authenticator to sign requests to the Acquia.
File
- src/
Client.php, line 371
Class
- Client
- Acquia connector client.
Namespace
Drupal\acquia_connectorCode
protected function buildAuthenticator($key, int $request_time, array $params = []) {
$authenticator = [];
if (isset($params['identifier'])) {
// Put Subscription ID in authenticator but do not use in hash.
$authenticator['identifier'] = $params['identifier'];
unset($params['identifier']);
}
$nonce = $this
->getNonce();
$authenticator['time'] = $request_time;
$authenticator['hash'] = $this
->hash($key, $request_time, $nonce);
$authenticator['nonce'] = $nonce;
return $authenticator;
}