protected function EndpointAccessibilityRequirement::getAuthorizationHeader in Acquia Content Hub 8
Gets the authorization header for a given endpoint and method.
Parameters
string $endpoint: Url of endpoint.
string $method: Method of the request. (e.g GET or POST).
Return value
string The authorization header.
1 call to EndpointAccessibilityRequirement::getAuthorizationHeader()
- EndpointAccessibilityRequirement::testContentViewEndpoint in acquia_contenthub_diagnostic/
src/ Plugin/ ContentHubRequirement/ EndpointAccessibilityRequirement.php - Test the content view endpoint.
File
- acquia_contenthub_diagnostic/
src/ Plugin/ ContentHubRequirement/ EndpointAccessibilityRequirement.php, line 209
Class
- EndpointAccessibilityRequirement
- Defines an endpoint accessibility requirement.
Namespace
Drupal\acquia_contenthub_diagnostic\Plugin\ContentHubRequirementCode
protected function getAuthorizationHeader($endpoint, $method = 'GET') {
$request = Request::create($endpoint, $method);
$subscription = \Drupal::service('acquia_contenthub.acquia_contenthub_subscription');
$shared_secret = $subscription
->getSharedSecret();
$signature = $this->clientManager
->getRequestSignature($request, $shared_secret);
return 'Acquia ContentHub:' . $signature;
}