feat: drop the TYPO3 api key query parameter

This commit is contained in:
fromme committed 2026-10-08 11:45:24 +02:00
1 parent 2d876152aa
commit ff7ddf7a9e
3 files changed
+2 -6

No files matched your search

-1
View File
@@ -336,7 +336,6 @@ services:
App\Service\CmsDataProvider: App\Service\CmsDataProvider:
arguments: arguments:
$httpClient: '@typo3.client' $httpClient: '@typo3.client'
$apiKey: '%env(APP_CMS_API_KEY)%'
App\Logger\RequestIdProcessor: App\Logger\RequestIdProcessor:
tags: tags:
-3
View File
@@ -14,7 +14,6 @@ class CmsDataProvider
public function __construct( public function __construct(
private readonly HttpClientInterface $httpClient, private readonly HttpClientInterface $httpClient,
private readonly CacheInterface $cache, private readonly CacheInterface $cache,
private readonly string $apiKey,
) { ) {
} }
@@ -93,7 +92,6 @@ class CmsDataProvider
$request = $this->httpClient->request('GET', 'api/hotel', [ $request = $this->httpClient->request('GET', 'api/hotel', [
'query' => [ 'query' => [
'hotel' => $hotelCode, 'hotel' => $hotelCode,
'key' => $this->apiKey,
], ],
]); ]);
} catch (ExceptionInterface $e) { } catch (ExceptionInterface $e) {
@@ -184,7 +182,6 @@ class CmsDataProvider
'query' => [ 'query' => [
'product' => $productCode, 'product' => $productCode,
'hotel' => $hotelCode, 'hotel' => $hotelCode,
'key' => $this->apiKey,
], ],
]); ]);
} catch (ExceptionInterface $e) { } catch (ExceptionInterface $e) {
+2 -2
View File
@@ -45,7 +45,7 @@ class CmsDataProviderTest extends TestCase
], ],
], JSON_THROW_ON_ERROR))); ], JSON_THROW_ON_ERROR)));
$provider = new CmsDataProvider($client, new ArrayAdapter(), 'test-key'); $provider = new CmsDataProvider($client, new ArrayAdapter());
$data = $provider->getHotelDetails('HOTEL1'); $data = $provider->getHotelDetails('HOTEL1');
@@ -75,7 +75,7 @@ class CmsDataProviderTest extends TestCase
{ {
$client = new MockHttpClient(fn () => new MockResponse('', ['http_code' => 500])); $client = new MockHttpClient(fn () => new MockResponse('', ['http_code' => 500]));
$provider = new CmsDataProvider($client, new ArrayAdapter(), 'test-key'); $provider = new CmsDataProvider($client, new ArrayAdapter());
self::assertNull($provider->getHotelDetails('UNKNOWN')); self::assertNull($provider->getHotelDetails('UNKNOWN'));
} }