1 | <?php |
||
10 | class StaticTokenRepository implements BearerTokenRepositoryInterface |
||
|
|||
11 | { |
||
12 | /** |
||
13 | * array |
||
14 | */ |
||
15 | private $validTokens = []; |
||
16 | |||
17 | /** |
||
18 | * Create static bearer token repository. |
||
19 | * You can pass multiple tokens that will be available for your api. |
||
20 | * Format is associtive array where key is token string and value is IP range |
||
21 | * |
||
22 | * Example: |
||
23 | * ['ef0p9iwehjgoihrgrsdgfoihw4t' => '*'] |
||
24 | * |
||
25 | * Or: |
||
26 | * ['asfoihegoihregoihrhgrehg' => '127.0.0.1', 'asfo9uyewtoiyewgt4ty4r' => '*'] |
||
27 | * |
||
28 | * @see BearerTokenAuthorization#isValidIp for all available Ip range formats |
||
29 | * |
||
30 | * @param array $validTokens |
||
31 | */ |
||
32 | public function __construct($validTokens = []) |
||
36 | |||
37 | /** |
||
38 | * {@inheritdoc} |
||
39 | */ |
||
40 | public function validToken(string $token): bool |
||
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | public function ipRestrictions(string $token): ?string |
||
55 | } |
||
56 |
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.