Cambios de usos de env vars
This commit is contained in:
@ -16,9 +16,16 @@ class API
|
||||
protected Service\API $apiService,
|
||||
protected Service\Login $loginService,
|
||||
protected string $key,
|
||||
protected array $permittedPaths,
|
||||
protected array $simplePaths,
|
||||
protected array $externalPaths) {}
|
||||
array $apiUrls)
|
||||
{
|
||||
$this->permittedPaths = $apiUrls['permittedPaths'];
|
||||
$this->simplePaths = $apiUrls['simplePaths'];
|
||||
$this->externalPaths = $apiUrls['externalPaths'];
|
||||
}
|
||||
|
||||
protected array $permittedPaths;
|
||||
protected array $simplePaths;
|
||||
protected array $externalPaths;
|
||||
|
||||
public function __invoke(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
|
||||
{
|
||||
@ -27,7 +34,10 @@ class API
|
||||
}
|
||||
try {
|
||||
$key = $this->apiService->getKey($request);
|
||||
} catch (MissingAuthorizationHeader) {
|
||||
} catch (MissingAuthorizationHeader $exception) {
|
||||
$this->logger->warning($exception, [
|
||||
'headers' => $request->getHeaders()
|
||||
]);
|
||||
return $this->responseFactory->createResponse(401);
|
||||
}
|
||||
if ($this->validateSimpleKey($request, $key)) {
|
||||
|
Reference in New Issue
Block a user