Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
31 | 2 | public function __invoke(callable $handler): callable |
|
32 | { |
||
33 | return function(RequestInterface $request, array $options) use ($handler) { |
||
34 | 2 | return $handler($request, $options)->then( |
|
35 | function(ResponseInterface $response) { |
||
36 | 2 | $publicKey = $this->publicKeyGetter->getVerifyingKey($response); |
|
37 | 2 | $this->sapient->verifySignedResponse( |
|
38 | 2 | $response, |
|
39 | 2 | new SigningPublicKey(Base64UrlSafe::decode($publicKey)) |
|
40 | ); |
||
41 | |||
42 | 1 | return $response; |
|
43 | 2 | } |
|
48 |