@@ -57,7 +57,7 @@ |
||
57 | 57 | ); |
58 | 58 | |
59 | 59 | $responseSignature = $response->getHeaderLine('X-Server-Authorization-HMAC-SHA256'); |
60 | - $compareSignature = $compareResponse->getHeaderLine('X-Server-Authorization-HMAC-SHA256'); |
|
60 | + $compareSignature = $compareResponse->getHeaderLine('X-Server-Authorization-HMAC-SHA256'); |
|
61 | 61 | |
62 | 62 | return hash_equals($compareSignature, $responseSignature); |
63 | 63 | } |
@@ -48,10 +48,10 @@ |
||
48 | 48 | */ |
49 | 49 | public function __invoke(callable $handler) |
50 | 50 | { |
51 | - return function ($request, array $options) use ($handler) { |
|
51 | + return function($request, array $options) use ($handler) { |
|
52 | 52 | $request = $this->signRequest($request); |
53 | 53 | |
54 | - $promise = function (ResponseInterface $response) use ($request) { |
|
54 | + $promise = function(ResponseInterface $response) use ($request) { |
|
55 | 55 | if ($response->getStatusCode() != 401) { |
56 | 56 | $authenticator = new ResponseAuthenticator($request, $this->key); |
57 | 57 |
@@ -90,7 +90,7 @@ |
||
90 | 90 | $hashedBody = $this->digest->hash((string) $body); |
91 | 91 | |
92 | 92 | /** @var RequestInterface $request */ |
93 | - $request = $request->withHeader('X-Authorization-Content-SHA256', $hashedBody); |
|
93 | + $request = $request->withHeader('X-Authorization-Content-SHA256', $hashedBody); |
|
94 | 94 | |
95 | 95 | return $request; |
96 | 96 | } |
@@ -348,8 +348,7 @@ |
||
348 | 348 | |
349 | 349 | try { |
350 | 350 | return $authenticator->authenticate($psr7_request); |
351 | - } |
|
352 | - catch (KeyNotFoundException $exception) { |
|
351 | + } catch (KeyNotFoundException $exception) { |
|
353 | 352 | $this->loggerFactory |
354 | 353 | ->get('acquia_contenthub') |
355 | 354 | ->debug('HMAC validation failed. [authorization_header = %authorization_header]', [ |
@@ -194,7 +194,7 @@ |
||
194 | 194 | $this->clientCredentials = new HmacAuthMiddleware( |
195 | 195 | new Key($credentials['api_key'], $credentials['api_secret']), |
196 | 196 | $this->getRealm(), |
197 | - $this->getServiceApiHeader() ? [$this->getServiceApiHeader()]: [] |
|
197 | + $this->getServiceApiHeader() ? [$this->getServiceApiHeader()] : [] |
|
198 | 198 | ); |
199 | 199 | } |
200 | 200 | return $this; |