1 | <?php |
||
20 | class HttpsAuth implements SubscriberInterface |
||
21 | { |
||
22 | const AUTH_NAME = 'gigya'; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $apiKey; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | private $secret; |
||
33 | |||
34 | /** |
||
35 | * @var null|string |
||
36 | */ |
||
37 | private $userKey; |
||
38 | |||
39 | /** |
||
40 | * @param string $apiKey |
||
41 | * @param string $secret |
||
42 | * @param string|null $userKey |
||
43 | */ |
||
44 | 52 | public function __construct($apiKey, $secret, $userKey = null) |
|
50 | |||
51 | /** |
||
52 | * Returns an array of event names this subscriber wants to listen to. |
||
53 | * |
||
54 | * @return array |
||
55 | */ |
||
56 | 8 | public function getEvents() |
|
60 | |||
61 | /** |
||
62 | * Add the authentication params to the request. |
||
63 | * |
||
64 | * @param BeforeEvent $event |
||
65 | */ |
||
66 | 11 | public function sign(BeforeEvent $event) |
|
78 | |||
79 | /** |
||
80 | * @return string |
||
81 | */ |
||
82 | 39 | public function getApiKey() |
|
86 | |||
87 | /** |
||
88 | * @return string |
||
89 | */ |
||
90 | 39 | public function getSecret() |
|
94 | |||
95 | /** |
||
96 | * @return string|null |
||
97 | */ |
||
98 | 39 | public function getUserKey() |
|
102 | } |
||
103 |