mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-04 02:05:16 +02:00
Added an very basic system to configure info providers
This commit is contained in:
parent
9e3cb4d694
commit
e0301f096f
12 changed files with 689 additions and 0 deletions
17
config/packages/http_client.yaml
Normal file
17
config/packages/http_client.yaml
Normal 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
|
|
@ -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
|
||||
####################################################################################################################
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue