Subida del módulo y tema de PrestaShop

This commit is contained in:
Kaloyan
2026-04-09 18:31:51 +02:00
parent 12c253296f
commit 16b3ff9424
39262 changed files with 7418797 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
# Dedicated config for Oauth Endpoint, these are the common rules for all environments (dev, prod, test)
# They specify the dedicated security rules and routing mostly
imports:
- { resource: security.yml }
- { resource: services.yml }
framework:
router:
resource: "%kernel.project_dir%/app/config/admin-api/routing.yml"
strict_requirements: ~
api_platform:
formats:
json: [ 'application/json', 'application/merge-patch+json' ]
# Allow this format for other API endpoint than native endpoint (by default we will use json)
jsonld: [ 'application/ld+json' ]
# Multipart format for file upload
multipart: [ 'multipart/form-data' ]
patch_formats:
json: [ 'application/merge-patch+json' ]
error_formats:
json: [ 'application/json' ]
mapping:
paths:
- '%kernel.project_dir%/src/PrestaShopBundle/ApiPlatform/Resources'
oauth:
enabled: true
type: 'oauth2'
flow: 'clientCredentials'
tokenUrl: '/admin-api/access_token'

View File

@@ -0,0 +1,9 @@
imports:
- { resource: ../config_dev.yml }
- { resource: config.yml }
framework:
router:
resource: "%kernel.project_dir%/app/config/admin-api/routing_dev.yml"
strict_requirements: ~
profiler: { only_exceptions: false }

View File

@@ -0,0 +1,3 @@
imports:
- { resource: ../config_prod.yml }
- { resource: config.yml }

View File

@@ -0,0 +1,9 @@
imports:
- { resource: ../config_test.yml }
- { resource: config.yml }
framework:
router:
resource: "%kernel.project_dir%/app/config/admin-api/routing_test.yml"
strict_requirements: ~
profiler: { only_exceptions: false }

View File

@@ -0,0 +1,6 @@
_api_oauth2_routing:
resource: "@PrestaShopBundle/Resources/config/routing/admin-api.yml"
_api_platform_routing:
resource: .
type: api_platform

View File

@@ -0,0 +1,14 @@
_api_common:
resource: routing.yml
_wdt:
resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
prefix: /_wdt
_profiler:
resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
prefix: /_profiler
_errors:
resource: "@FrameworkBundle/Resources/config/routing/errors.xml"
prefix: /_error

View File

@@ -0,0 +1,5 @@
_api_common:
resource: routing.yml
test:
resource: "../../../tests/Resources/config/routes.yml"

View File

@@ -0,0 +1,28 @@
# Security rules for OAuth Application
security:
enable_authenticator_manager: true
password_hashers:
# auto hasher with default options for the User class (and children)
PrestaShopBundle\Entity\ApiClient: 'auto'
# auto hasher with custom options for all PasswordAuthenticatedUserInterface instances
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface:
algorithm: 'auto'
cost: 15
Symfony\Component\Security\Core\User\User: plaintext
firewalls:
# disables authentication for assets and the profiler, adapt it according to your needs
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
api_token:
pattern: ^/access_token
security: false
main:
stateless: true
custom_authenticators:
- PrestaShop\PrestaShop\Core\Security\OAuth2\TokenAuthenticator

View File

@@ -0,0 +1,73 @@
# Dedicated services for OAuth app
services:
_defaults:
public: false
autowire: true
autoconfigure: true
PrestaShopBundle\EventListener\API\AdminAPIFeatureListener:
autowire: true
tags:
- { name: kernel.event_listener, event: kernel.request, method: onKernelRequest, priority: 8 }
# CRITICAL this listener must have a priority greater than ApiPlatform ReadListener (which has a priority of 4)
# but it must be run AFTER the Firewall listener or the Security token won't be initialized yet (which has a
# priority of 8)
PrestaShopBundle\EventListener\API\ScopeCheckerListener:
autowire: true
tags:
- { name: kernel.event_listener, event: kernel.request, method: onKernelRequest, priority: 7 }
# We set a high priority so this listener has a bigger one than ReadListener ApiPlatform (which has a priority of 4)
PrestaShopBundle\EventListener\API\Context\ApiClientContextListener:
tags:
- { name: kernel.event_listener, event: kernel.request, method: onKernelRequest, priority: 7 }
# We set a high priority so this listener has a bigger one than ReadListener ApiPlatform (which has a priority of 4)
# but lower than the ApiClientListener because the listener depends on it
PrestaShopBundle\EventListener\API\Context\ShopContextListener:
tags:
- { name: kernel.event_listener, event: kernel.request, method: onKernelRequest, priority: 6 }
# We set a high priority so this listener has a bigger one than ReadListener ApiPlatform (which has a priority of 4)
# but lower than the ShopContextListener because the listener depends on it
PrestaShopBundle\EventListener\API\Context\LanguageContextListener:
tags:
- { name: kernel.event_listener, event: kernel.request, method: onKernelRequest, priority: 5 }
# We set a high priority so this listener has a bigger one than ReadListener ApiPlatform (which has a priority of 4)
# but lower than the ShopContextListener because the listener depends on it
PrestaShopBundle\EventListener\API\Context\CurrencyContextListener:
tags:
- { name: kernel.event_listener, event: kernel.request, method: onKernelRequest, priority: 5 }
# We need to leave this under the LanguageContextListener for priorities.
PrestaShopBundle\EventListener\API\Context\ApiLegacyContextListener:
arguments:
$legacyBuilders:
- '@PrestaShop\PrestaShop\Core\Context\LanguageContextBuilder'
- '@PrestaShop\PrestaShop\Core\Context\CurrencyContextBuilder'
tags:
- { name: kernel.event_listener, event: kernel.request, method: onKernelRequest, priority: 5 }
# SSL middleware
PrestaShopBundle\EventListener\API\SSLMiddlewareListener:
autowire: true
arguments:
$isDebug: '%kernel.debug%'
tags:
- { name: kernel.event_listener, event: kernel.request, method: onKernelRequest }
# Serializer modifications, the following services are automatically injected in the serializer Symfony service,
# to limit their impact on the Admin they are only defined for the API context.
# This normalizer disables the denormalization process of File fields
PrestaShopBundle\ApiPlatform\Normalizer\UploadedFileNormalizer:
autowire: true
autoconfigure: true
# Tag to be injected in the DomainSerializer
tags: [ 'prestashop.api.normalizers' ]
# This is the encoder to handle multipart requests for API
PrestaShopBundle\ApiPlatform\Encoder\MultipartDecoder:
autowire: true
autoconfigure: true