1 | <?php |
||
10 | class Authentication |
||
11 | { |
||
12 | /** @var string */ |
||
13 | private $key; |
||
14 | |||
15 | /** @var string */ |
||
16 | private $secret; |
||
17 | |||
18 | /** @var string */ |
||
19 | private $nonce; |
||
20 | |||
21 | /** |
||
22 | * Authentication constructor. |
||
23 | * @param string $key |
||
24 | * @param string $secret |
||
25 | * @param string $nonce |
||
26 | */ |
||
27 | public function __construct(string $key, string $secret, string $nonce) |
||
33 | |||
34 | /** |
||
35 | * @param callable $next |
||
36 | * @return Closure |
||
37 | */ |
||
38 | public function __invoke(callable $next) |
||
49 | |||
50 | /** |
||
51 | * @param RequestInterface $request |
||
52 | * @return RequestInterface |
||
53 | */ |
||
54 | private function addAuthQueryParams(RequestInterface $request): RequestInterface |
||
63 | |||
64 | /** |
||
65 | * @param string $uri |
||
66 | * @return string |
||
67 | */ |
||
68 | private function generateSign(string $uri): string |
||
72 | } |
||
73 |