| 1 | <?php |
||
| 12 | class AllAccessConfigurationListAccessControl implements AccessControl |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var Configuration |
||
| 16 | */ |
||
| 17 | protected $config; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var string |
||
| 21 | */ |
||
| 22 | protected $configKey; |
||
| 23 | /** |
||
| 24 | * @var string |
||
| 25 | */ |
||
| 26 | private $namespace; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @param Configuration $config a config that has a list of valid keys in the stored $configKey |
||
| 30 | * @param $namespace |
||
| 31 | * @param string $configKey key to use when accessing the list of valid keys from the $config |
||
| 32 | */ |
||
| 33 | 2 | public function __construct(Configuration $config, string $namespace, string $configKey = 'keys') |
|
| 39 | |||
| 40 | /** |
||
| 41 | * @param \LunixREST\APIRequest\APIRequest $request |
||
| 42 | * @return bool true if this key is valid |
||
| 43 | */ |
||
| 44 | 1 | public function validateAccess(APIRequest $request) |
|
| 48 | |||
| 49 | /** |
||
| 50 | * @param $apiKey |
||
| 51 | * @return bool true if the key is found inside of the array returned by the config when $config->get is called with the key from the constructor |
||
| 52 | */ |
||
| 53 | 2 | public function validateKey($apiKey) |
|
| 57 | } |
||
| 58 |