1 | <?php |
||
14 | class AuthBasicMiddleware implements MiddlewareInterface |
||
15 | { |
||
16 | protected $config; |
||
17 | |||
18 | /** |
||
19 | * @var User|UserInterface |
||
20 | */ |
||
21 | protected $user; |
||
22 | |||
23 | public function __construct(ConfigInterface $config, UserInterface $user) |
||
28 | |||
29 | /** |
||
30 | * @param ServerRequestInterface $request |
||
31 | * @param ResponseInterface $response |
||
32 | * @param callable|null $next |
||
33 | * @return EmptyResponse |
||
34 | * @throws \Exception |
||
35 | */ |
||
36 | public function __invoke( |
||
48 | |||
49 | /** |
||
50 | * @param string $login |
||
51 | * @param string $pass |
||
52 | * @return bool |
||
53 | */ |
||
54 | protected function checkCredentials($login, $pass) |
||
68 | |||
69 | /** |
||
70 | * @param string $authHeader |
||
71 | * @return bool |
||
72 | */ |
||
73 | protected function checkHeader($authHeader) |
||
89 | |||
90 | /** |
||
91 | * @param ServerRequestInterface $request |
||
92 | * @return bool |
||
93 | */ |
||
94 | protected function isAdminAuthentication(ServerRequestInterface $request) |
||
106 | } |
||
107 |