public function HmacWrapper::getMiddleware in Acquia Content Hub 8
Gets the middleware.
Return value
mixed The middleware.
File
- src/
Middleware/ HmacWrapper.php, line 50
Class
- HmacWrapper
- Wrapper for HMAC.
Namespace
Drupal\acquia_contenthub\MiddlewareCode
public function getMiddleware() {
// When HMAC V2 is supported, grab the configured version below.
// $version = $config->get('hmac_version');.
$version = 'V1';
$class = "\\Acquia\\ContentHubClient\\Middleware\\MiddlewareHmac" . $version;
$middleware = new $class($this->apiKey, $this->secretKey, $version);
return $middleware
->getMiddleware();
}