welcome back to dyb-tech
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
|
||||
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
|
||||
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
|
||||
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
|
||||
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
|
||||
Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true],
|
||||
Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true],
|
||||
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
|
||||
Nelmio\ApiDocBundle\NelmioApiDocBundle::class => ['all' => true],
|
||||
];
|
||||
@@ -0,0 +1,30 @@
|
||||
-----BEGIN ENCRYPTED PRIVATE KEY-----
|
||||
MIIFHDBOBgkqhkiG9w0BBQ0wQTApBgkqhkiG9w0BBQwwHAQInDeviyrjeGECAggA
|
||||
MAwGCCqGSIb3DQIJBQAwFAYIKoZIhvcNAwcECOv8u+sIrYZyBIIEyH00Kuv7H9X/
|
||||
pbCCgoQaisJ8oWyakZEvxJY+bvpteYMRqFBGfSSCwM198FhR49+gf29hWsr8bF3f
|
||||
zoS+e8dnkzaVebBZ582FVAWUWdTBVct2CNHXDLTmwz/PJel/xGXXEqpoyb2wcxrr
|
||||
+m3kEJq00AV2m5zDcPjL3lP71pEta2DwuPfKgs+n9KnqGO94zuj0Q+pe7hEVlfia
|
||||
nKbmUWfXRSXscBv7dzt/Npl0pRiDkPCSPCKIXZfrVa8agxrUQbS422cVNtee8h5u
|
||||
dqU5ZrnfmUOogRWW+/Is8HbdMPk1u1TGlHIBeJeJCeR7cype6KXFvZKqREP1MhH3
|
||||
u9ge+J14PRqdm2ZeGpeKyvpnmrObE+qSeSShrttaytC6862IBJAc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y02L7KyVa3wTn9QHu+9bwUBUI7cBmjindWXNdCbzNYoNevAwAgsfCoK0LZmp
|
||||
BxbJ9e68yZXkIrEnxkl4tboaidhn/zDcf9msJfdZqwbfPtdDheIFGjgvZYPBxDzA
|
||||
W9/4YGwwRFznycTobhLmBCYqpUrON7nXNdvMvSaG3mQevkRBRBVNTIxEufq6u/11
|
||||
FrT/2kmFKAMPfypwV4PEZRaoJuxpnjWgMDQV1+W0HC0xdIlrTEySEmhTRiTdax8F
|
||||
rvvz81Q6bF7l6y5xVcWv2g==
|
||||
-----END ENCRYPTED PRIVATE KEY-----
|
||||
@@ -0,0 +1,9 @@
|
||||
-----BEGIN PUBLIC KEY-----
|
||||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwDsrme1BZmfXZF9XDBGY
|
||||
l/eBtM04MTfHC5IV9HI4scoiFsQUUgxiESrE1ATwzd94E/V98W6xeApKpRlHKulb
|
||||
/AxoBo+FaHZLIAEwfkSsqHhhcTATfdkI3nLd3OksbuqDg19nrWoStjTeig9jb3op
|
||||
GezkL+fHcrUpBUFdT0jkuyR/hnIaYtWK6xalWodozJjPHxNC69X7p6xuWGPkRW2q
|
||||
Plm1GzBl4hsvdZ0QfTJQC8aGPXII6Ug5jAySN4jvNSEQNDrnrZ1aiD+A8mnePaE/
|
||||
le9Md4h/pMAn0ku9nv1dTMmFOl7xZUPpG2Qq7wilHyejtU2sLi8MciJaUSesg5ee
|
||||
dwIDAQAB
|
||||
-----END PUBLIC KEY-----
|
||||
@@ -0,0 +1,19 @@
|
||||
framework:
|
||||
cache:
|
||||
# Unique name of your app: used to compute stable namespaces for cache keys.
|
||||
#prefix_seed: your_vendor_name/app_name
|
||||
|
||||
# The "app" cache stores to the filesystem by default.
|
||||
# The data in this cache should persist between deploys.
|
||||
# Other options include:
|
||||
|
||||
# Redis
|
||||
#app: cache.adapter.redis
|
||||
#default_redis_provider: redis://localhost
|
||||
|
||||
# APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)
|
||||
#app: cache.adapter.apcu
|
||||
|
||||
# Namespaced pools use the above "app" backend by default
|
||||
#pools:
|
||||
#my.dedicated.cache: null
|
||||
@@ -0,0 +1,5 @@
|
||||
maker:
|
||||
# tell MakerBundle that all of your classes live in an
|
||||
# Acme namespace, instead of the default App
|
||||
# (e.g. Acme\Entity\Article, Acme\Command\MyCommand, etc)
|
||||
root_namespace: 'DMD\LaLigaApi\'
|
||||
@@ -0,0 +1,49 @@
|
||||
doctrine:
|
||||
dbal:
|
||||
# url: '%env(resolve:DATABASE_URL)%'
|
||||
url: 'mysql://root:root@localhost:3307/la_liga?serverVersion=8.0.32&charset=utf8mb4'
|
||||
# url: 'mysql://root:root@localhost:3307/la_liga?serverVersion=7.4.16&charset=utf8mb4'
|
||||
# IMPORTANT: You MUST configure your server version,
|
||||
# either here or in the DATABASE_URL env var (see .env file)
|
||||
#server_version: '15'
|
||||
|
||||
profiling_collect_backtrace: '%kernel.debug%'
|
||||
orm:
|
||||
auto_generate_proxy_classes: true
|
||||
enable_lazy_ghost_objects: true
|
||||
report_fields_where_declared: true
|
||||
validate_xml_mapping: true
|
||||
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
|
||||
auto_mapping: true
|
||||
mappings:
|
||||
DMD\LaLigaApi:
|
||||
is_bundle: false
|
||||
dir: '%kernel.project_dir%/src/Entity'
|
||||
prefix: 'DMD\LaLigaApi\Entity'
|
||||
alias: App
|
||||
|
||||
when@test:
|
||||
doctrine:
|
||||
dbal:
|
||||
# "TEST_TOKEN" is typically set by ParaTest
|
||||
dbname_suffix: '_test%env(default::TEST_TOKEN)%'
|
||||
|
||||
when@prod:
|
||||
doctrine:
|
||||
orm:
|
||||
auto_generate_proxy_classes: false
|
||||
proxy_dir: '%kernel.build_dir%/doctrine/orm/Proxies'
|
||||
query_cache_driver:
|
||||
type: pool
|
||||
pool: doctrine.system_cache_pool
|
||||
result_cache_driver:
|
||||
type: pool
|
||||
pool: doctrine.result_cache_pool
|
||||
|
||||
framework:
|
||||
cache:
|
||||
pools:
|
||||
doctrine.result_cache_pool:
|
||||
adapter: cache.app
|
||||
doctrine.system_cache_pool:
|
||||
adapter: cache.system
|
||||
@@ -0,0 +1,6 @@
|
||||
doctrine_migrations:
|
||||
migrations_paths:
|
||||
# namespace is arbitrary but should be different from App\Migrations
|
||||
# as migrations classes should NOT be autoloaded
|
||||
'DoctrineMigrations': '%kernel.project_dir%/migrations'
|
||||
enable_profiler: false
|
||||
@@ -0,0 +1,25 @@
|
||||
# see https://symfony.com/doc/current/reference/configuration/framework.html
|
||||
framework:
|
||||
secret: '%env(APP_SECRET)%'
|
||||
#csrf_protection: true
|
||||
http_method_override: false
|
||||
handle_all_throwables: true
|
||||
|
||||
# Enables session support. Note that the session will ONLY be started if you read or write from it.
|
||||
# Remove or comment this section to explicitly disable session support.
|
||||
session:
|
||||
handler_id: null
|
||||
cookie_secure: auto
|
||||
cookie_samesite: lax
|
||||
storage_factory_id: session.storage.factory.native
|
||||
|
||||
#esi: true
|
||||
#fragments: true
|
||||
php_errors:
|
||||
log: true
|
||||
|
||||
when@test:
|
||||
framework:
|
||||
test: true
|
||||
session:
|
||||
storage_factory_id: session.storage.factory.mock_file
|
||||
@@ -0,0 +1,5 @@
|
||||
lexik_jwt_authentication:
|
||||
secret_key: '%env(resolve:JWT_SECRET_KEY)%'
|
||||
public_key: '%env(resolve:JWT_PUBLIC_KEY)%'
|
||||
pass_phrase: '%env(JWT_PASSPHRASE)%'
|
||||
token_ttl: 1800
|
||||
@@ -0,0 +1,3 @@
|
||||
framework:
|
||||
mailer:
|
||||
dsn: 'smtp://soporteliga:dmdlakers06@localhost:8025?verify_peer=0'
|
||||
@@ -0,0 +1,9 @@
|
||||
nelmio_api_doc:
|
||||
documentation:
|
||||
info:
|
||||
title: My App
|
||||
description: This is an awesome app!
|
||||
version: 1.0.0
|
||||
areas: # to filter documented areas
|
||||
path_patterns:
|
||||
- ^/api(?!/doc$) # Accepts routes under /api except /api/doc
|
||||
@@ -0,0 +1,10 @@
|
||||
nelmio_cors:
|
||||
defaults:
|
||||
origin_regex: true
|
||||
allow_origin: ['*']
|
||||
allow_methods: ['GET', 'OPTIONS', 'POST', 'PUT', 'PATCH', 'DELETE']
|
||||
allow_headers: ['Content-Type', 'Authorization']
|
||||
expose_headers: ['Link']
|
||||
max_age: 3600
|
||||
paths:
|
||||
'^/': null
|
||||
@@ -0,0 +1,12 @@
|
||||
framework:
|
||||
router:
|
||||
utf8: true
|
||||
|
||||
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
|
||||
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
|
||||
#default_uri: http://localhost
|
||||
|
||||
when@prod:
|
||||
framework:
|
||||
router:
|
||||
strict_requirements: null
|
||||
@@ -0,0 +1,60 @@
|
||||
security:
|
||||
# https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords
|
||||
enable_authenticator_manager: true
|
||||
password_hashers:
|
||||
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
|
||||
# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
|
||||
providers:
|
||||
# used to reload user from session & other features (e.g. switch_user)
|
||||
app_user_provider:
|
||||
entity:
|
||||
class: DMD\LaLigaApi\Entity\User
|
||||
property: email
|
||||
firewalls:
|
||||
login:
|
||||
pattern: ^/api/login
|
||||
stateless: true
|
||||
json_login:
|
||||
check_path: /api/login_check
|
||||
success_handler: lexik_jwt_authentication.handler.authentication_success
|
||||
failure_handler: lexik_jwt_authentication.handler.authentication_failure
|
||||
|
||||
api:
|
||||
pattern: ^/api
|
||||
stateless: true
|
||||
jwt: ~
|
||||
|
||||
dev:
|
||||
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
||||
security: false
|
||||
main:
|
||||
lazy: true
|
||||
provider: app_user_provider
|
||||
|
||||
# activate different ways to authenticate
|
||||
# https://symfony.com/doc/current/security.html#the-firewall
|
||||
|
||||
# https://symfony.com/doc/current/security/impersonating_user.html
|
||||
# switch_user: true
|
||||
|
||||
# Easy way to control access for large sections of your site
|
||||
# Note: Only the *first* access control that matches will be used
|
||||
access_control:
|
||||
- { path: ^/api/login, roles: PUBLIC_ACCESS }
|
||||
- { path: ^/api/user/password, roles: PUBLIC_ACCESS }
|
||||
- { path: ^/api/public, roles: PUBLIC_ACCESS }
|
||||
- { path: ^/api/register, roles: PUBLIC_ACCESS }
|
||||
- { path: ^/api, roles: IS_AUTHENTICATED_FULLY }
|
||||
|
||||
when@test:
|
||||
security:
|
||||
password_hashers:
|
||||
# By default, password hashers are resource intensive and take time. This is
|
||||
# important to generate secure password hashes. In tests however, secure hashes
|
||||
# are not important, waste resources and increase test times. The following
|
||||
# reduces the work factor to the lowest possible values.
|
||||
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface:
|
||||
algorithm: auto
|
||||
cost: 4 # Lowest possible value for bcrypt
|
||||
time_cost: 3 # Lowest possible value for argon
|
||||
memory_cost: 10 # Lowest possible value for argon
|
||||
@@ -0,0 +1,6 @@
|
||||
twig:
|
||||
default_path: '%kernel.project_dir%/templates'
|
||||
|
||||
when@test:
|
||||
twig:
|
||||
strict_variables: true
|
||||
@@ -0,0 +1,13 @@
|
||||
framework:
|
||||
validation:
|
||||
email_validation_mode: html5
|
||||
|
||||
# Enables validator auto-mapping support.
|
||||
# For instance, basic validation constraints will be inferred from Doctrine's metadata.
|
||||
#auto_mapping:
|
||||
# App\Entity\: []
|
||||
|
||||
when@test:
|
||||
framework:
|
||||
validation:
|
||||
not_compromised_password: false
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
if (file_exists(dirname(__DIR__).'/var/cache/prod/DMD_LaLigaApi_KernelProdContainer.preload.php')) {
|
||||
require dirname(__DIR__).'/var/cache/prod/DMD_LaLigaApi_KernelProdContainer.preload.php';
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
controllers:
|
||||
resource:
|
||||
path: ../src/Controller/
|
||||
namespace: DMD\LaLigaApi\Controller
|
||||
type: attribute
|
||||
|
||||
api_login_check:
|
||||
path: /api/login_check
|
||||
@@ -0,0 +1,4 @@
|
||||
when@dev:
|
||||
_errors:
|
||||
resource: '@FrameworkBundle/Resources/config/routing/errors.xml'
|
||||
prefix: /_error
|
||||
@@ -0,0 +1,12 @@
|
||||
# Expose your documentation as JSON swagger compliant
|
||||
app.swagger:
|
||||
path: /api/doc.json
|
||||
methods: GET
|
||||
defaults: { _controller: nelmio_api_doc.controller.swagger }
|
||||
|
||||
## Requires the Asset component and the Twig bundle
|
||||
## $ composer require twig asset
|
||||
#app.swagger_ui:
|
||||
# path: /api/doc
|
||||
# methods: GET
|
||||
# defaults: { _controller: nelmio_api_doc.controller.swagger_ui }
|
||||
@@ -0,0 +1,31 @@
|
||||
# This file is the entry point to configure your own services.
|
||||
# Files in the packages/ subdirectory configure your dependencies.
|
||||
|
||||
# Put parameters here that don't need to change on each machine where the app is deployed
|
||||
# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration
|
||||
parameters:
|
||||
|
||||
services:
|
||||
# default configuration for services in *this* file
|
||||
_defaults:
|
||||
autowire: true # Automatically injects dependencies in your services.
|
||||
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
|
||||
|
||||
# makes classes in src/ available to be used as services
|
||||
# this creates a service per class whose id is the fully-qualified class name
|
||||
DMD\LaLigaApi\:
|
||||
resource: '../src/'
|
||||
exclude:
|
||||
- '../src/DependencyInjection/'
|
||||
- '../src/Entity/'
|
||||
- '../src/Kernel.php'
|
||||
|
||||
# add more service definitions when explicit configuration is needed
|
||||
# please note that last definitions always *replace* previous ones
|
||||
DMD\LaLigaApi\Exception\ExceptionListener:
|
||||
tags:
|
||||
- { name: kernel.event_listener, event: kernel.exception }
|
||||
|
||||
DMD\LaLigaApi\Service\User\Handlers\login\AuthenticationSuccessListener:
|
||||
tags:
|
||||
- { name: kernel.event_listener, event: lexik_jwt_authentication.on_authentication_success, method: onAuthenticationSuccessResponse }
|
||||
Reference in New Issue
Block a user