1 | <?php |
||
18 | class BasicAuth implements ExcluderInterface |
||
19 | { |
||
20 | /** |
||
21 | * List of user/password to be excluded. |
||
22 | * |
||
23 | * @var array |
||
24 | */ |
||
25 | protected $users = []; |
||
26 | |||
27 | /** |
||
28 | * @param array $users |
||
29 | */ |
||
30 | public function __construct(array $users = []) |
||
36 | |||
37 | /** |
||
38 | * Add user. |
||
39 | * |
||
40 | * @param string $username |
||
41 | * @param string|null $password |
||
42 | */ |
||
43 | public function addUser($username, $password = null) |
||
49 | |||
50 | /** |
||
51 | * {@inheritdoc} |
||
52 | */ |
||
53 | public function isExcluded(ServerRequestInterface $request) |
||
65 | |||
66 | /** |
||
67 | * Retrieve request authentication information. |
||
68 | * |
||
69 | * @param \Psr\Http\Message\ServerRequestInterface $request |
||
70 | * |
||
71 | * @return array |
||
72 | */ |
||
73 | protected function getAuth(ServerRequestInterface $request) |
||
90 | } |
||
91 |