TD-322: [BACK]. [реализовать сервис для подписания документов в контейнере signer]

This commit is contained in:
cherednik 2024-10-11 17:41:06 +04:00
parent e42e611f29
commit 74f3a069f0
2 changed files with 0 additions and 7 deletions

View File

@ -10,5 +10,4 @@ class SignRequest implements RequestDtoInterface
{
public string $url;
public int $batch;
public string $apiKey;
}

View File

@ -15,8 +15,6 @@ use Symfony\Component\Security\Core\Exception\AccessDeniedException;
class SignController extends AbstractController
{
private const string API_KEY = 'ldskfjhgsdkl;ftghwerot239845yjsdknbgedklhhg';
public function __construct(
private readonly SignService $signService
){
@ -25,10 +23,6 @@ class SignController extends AbstractController
#[Route(path: '/sign', name: 'app.sign', methods: ['POST'])]
public function __invoke(Request $request, SignRequest $signRequest): Response
{
if ($signRequest->apiKey !== self::API_KEY) {
throw new AccessDeniedException('доступ запрещен');
}
$token = $request->server->get('HTTP_AUTHORIZATION');
return new JsonResponse($this->signService->signDocument($signRequest->url, $token, $signRequest->batch));