private const SHOPWARE_TOKEN_HEADER = 'X-Shopware-Token';
public function __construct( private readonly AbstractStoreRequestOptionsProvider
$optionsProvider,
private readonly EntityRepository
$userConfigRepository,
) { } public function getAuthenticationHeader(Context
$context): array
{ return array_filter([self::SHOPWARE_TOKEN_HEADER =>
$this->
getFrwUserToken($context)]);
} public function getDefaultQueryParameters(Context
$context): array
{ return $this->optionsProvider->
getDefaultQueryParameters($context);
} private function getFrwUserToken(Context
$context): ?string
{ if (!
$context->
getSource() instanceof AdminApiSource
) { throw new InvalidContextSourceException(AdminApiSource::
class,
$context->
getSource()::
class);
}