Added an very basic system to configure info providers

This commit is contained in:
Jan Böhmer 2023-07-09 14:27:41 +02:00
parent 9e3cb4d694
commit e0301f096f
12 changed files with 689 additions and 0 deletions

View file

@ -0,0 +1,17 @@
framework:
http_client:
default_options:
headers:
'User-Agent': 'Part-DB'
scoped_clients:
digikey.client:
base_uri: 'https://sandbox-api.digikey.com'
auth_bearer: '%env(PROVIDER_DIGIKEY_TOKEN)%'
headers:
X-DIGIKEY-Client-Id: '%env(PROVIDER_DIGIKEY_CLIENT_ID)%'
X-DIGIKEY-Locale-Site: 'DE'
X-DIGIKEY-Locale-Language: 'de'
X-DIGIKEY-Locale-Currency: '%partdb.default_currency%'
X-DIGIKEY-Customer-Id: 0

View file

@ -24,6 +24,9 @@ services:
App\Services\LabelSystem\PlaceholderProviders\PlaceholderProviderInterface:
tags: ['app.label_placeholder_provider']
App\Services\InfoProviderSystem\Providers\InfoProviderInterface:
tags: ['app.info_provider']
# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
App\:
@ -234,6 +237,13 @@ services:
$rootNodeExpandedByDefault: '%partdb.sidebar.root_expanded%'
$rootNodeEnabled: '%partdb.sidebar.root_node_enable%'
####################################################################################################################
# Part info provider system
####################################################################################################################
App\Services\InfoProviderSystem\ProviderRegistry:
arguments:
$providers: !tagged_iterator 'app.info_provider'
####################################################################################################################
# Symfony overrides
####################################################################################################################