|
@@ -20,9 +20,10 @@ class ApiLegacyRequestService extends ApiRequestService
|
|
|
{
|
|
{
|
|
|
#[Pure]
|
|
#[Pure]
|
|
|
public function __construct(
|
|
public function __construct(
|
|
|
- HttpClientInterface $apiLegacyClient,
|
|
|
|
|
- private Security $security,
|
|
|
|
|
- private JWTTokenManagerInterface $jwtManager
|
|
|
|
|
|
|
+ HttpClientInterface $apiLegacyClient,
|
|
|
|
|
+ private readonly Security $security,
|
|
|
|
|
+ private readonly JWTTokenManagerInterface $jwtManager,
|
|
|
|
|
+ readonly private string $internalRequestsToken
|
|
|
)
|
|
)
|
|
|
{
|
|
{
|
|
|
parent::__construct($apiLegacyClient);
|
|
parent::__construct($apiLegacyClient);
|
|
@@ -33,7 +34,6 @@ class ApiLegacyRequestService extends ApiRequestService
|
|
|
* @param string $url
|
|
* @param string $url
|
|
|
* @param array<mixed> $parameters
|
|
* @param array<mixed> $parameters
|
|
|
* @param array<mixed> $options
|
|
* @param array<mixed> $options
|
|
|
- * @noinspection PhpPossiblePolymorphicInvocationInspection
|
|
|
|
|
*/
|
|
*/
|
|
|
public function request(
|
|
public function request(
|
|
|
string $method,
|
|
string $method,
|
|
@@ -74,6 +74,10 @@ class ApiLegacyRequestService extends ApiRequestService
|
|
|
if ($jwt !== null) {
|
|
if ($jwt !== null) {
|
|
|
$headers['authorization'] = 'BEARER ' . $jwt;
|
|
$headers['authorization'] = 'BEARER ' . $jwt;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // Add the internal requests token
|
|
|
|
|
+ $headers['internal-requests-token'] = $this->internalRequestsToken;
|
|
|
|
|
+
|
|
|
$options['headers'] = array_merge($options['headers'] ?? [], $headers);
|
|
$options['headers'] = array_merge($options['headers'] ?? [], $headers);
|
|
|
|
|
|
|
|
return parent::request($method, $url, $parameters, $options);
|
|
return parent::request($method, $url, $parameters, $options);
|