feature/cierres #31

Merged
aldarien merged 462 commits from feature/cierres into develop 2025-09-11 17:05:18 -03:00
241 changed files with 829 additions and 10487 deletions
Showing only changes of commit 2a792a947d - Show all commits

View File

@ -29,7 +29,10 @@ return [
],
'externalPaths' => [
'/api/external' => [
'/toku/success' => $_ENV['TOKU_TOKEN']
'/toku/success' => [
'header' => 'x-api-key',
'token' => $_ENV['TOKU_TOKEN']
]
],
]
];

View File

@ -85,6 +85,13 @@ class API
}
protected function validateExternalKey(ServerRequestInterface $request, $basePath, $subPath): bool
{
$data = $this->externalPaths[$basePath][$subPath];
if (isset($data['header']) and $request->hasHeader($data['header'])) {
$token = $request->getHeaderLine($data['header']);
if ($token === $this->externalPaths[$basePath][$subPath]['token']) {
return true;
}
}
if ($request->hasHeader('x-api-key')) {
$key = $request->getHeaderLine('x-api-key');
if ($key === $this->externalPaths[$basePath][$subPath]) {