1 | <?php |
||
13 | final class Security implements Common |
||
14 | { |
||
15 | private $client; |
||
16 | |||
17 | /** |
||
18 | * Security constructor. |
||
19 | * |
||
20 | * @param Client $client |
||
21 | * @throws Exception |
||
22 | */ |
||
23 | 1 | public function __construct(Client $client) |
|
31 | |||
32 | public function getUrl($method, array $params = []) |
||
33 | { |
||
34 | switch ($method) { |
||
35 | case 'getSecretKey': |
||
36 | return [ |
||
37 | 'url' => '/1.0/security/secretKey', |
||
38 | 'method' => 'GET', |
||
39 | 'code' => 200 |
||
40 | ]; |
||
41 | case 'getDemoUrl': |
||
42 | return [ |
||
43 | 'url' => '/1.0/security/demoUrl', |
||
44 | 'method' => 'GET', |
||
45 | 'code' => 200 |
||
46 | ]; |
||
47 | case 'getAutologinUrl': |
||
48 | return [ |
||
49 | 'url' => '/1.0/security/autologinUrl', |
||
50 | 'method' => 'GET', |
||
51 | 'code' => 200 |
||
52 | ]; |
||
53 | default: |
||
54 | throw new Exception('Route for ' . $method . ' not found'); |
||
55 | } |
||
56 | } |
||
57 | |||
58 | public function getDemoUrl($type, $id) |
||
62 | |||
63 | public function getAutologinUrl($uid, $fio = null, $email = null, $redirect = null) { |
||
75 | } |