private function isAllowed(RequestInterface $request, ServerHttpRequest $httpRequest) { if (in_array($request->getRequestName(), $this->publicMessageNames, true)) { return true; } try { $this->tokenService->getToken(Uuid::fromString($httpRequest->getHeaderLine('Authentication-Token')), $httpRequest->getHeaderLine('Authentication-Pass-Code')); return true; } catch (\Throwable $exception) { if (!$exception instanceof AuthException) { $this->log(LogLevel::ERROR, $exception->getMessage()); } return false; } }
protected function supports(RequestInterface $request) : bool { return array_key_exists($request->getRequestName(), $this->executors) && isset($this->container[$this->executors[$request->getRequestName()]]); }