Base du projet 'application ticketing'

This commit is contained in:
2020-02-17 22:28:57 +01:00
parent 2a72ac97ac
commit afa734f96d
64 changed files with 1798 additions and 685 deletions

View File

@ -7,4 +7,7 @@ return [
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true],
Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true],
];

View File

@ -0,0 +1,10 @@
nelmio_cors:
defaults:
origin_regex: true
allow_origin: ['%env(CORS_ALLOW_ORIGIN)%']
allow_methods: ['GET', 'OPTIONS', 'POST', 'PUT', 'PATCH', 'DELETE']
allow_headers: ['Content-Type', 'Authorization']
expose_headers: ['Link']
max_age: 3600
paths:
'^/': null

View File

@ -1,13 +1,26 @@
security:
encoders:
App\Entity\User:
algorithm: auto
# https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
providers:
in_memory: { memory: null }
# used to reload user from session & other features (e.g. switch_user)
app_user_provider:
entity:
class: App\Entity\User
property: username
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
anonymous: lazy
anonymous: ~
json_login:
check_path: /api/v1/login
logout:
path: /api/v1/logout
target: /api/v1
# activate different ways to authenticate
# https://symfony.com/doc/current/security.html#firewalls-authentication
@ -18,5 +31,3 @@ security:
# 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: ^/admin, roles: ROLE_ADMIN }
# - { path: ^/profile, roles: ROLE_USER }

View File

@ -0,0 +1,3 @@
sensio_framework_extra:
router:
annotations: false

View File

@ -2,29 +2,9 @@
# path: /
# controller: App\Controller\DefaultController::index
app_home:
path: /
controller: Symfony\Bundle\FrameworkBundle\Controller\RedirectController::urlRedirectAction
defaults:
path: /api/v1
permanent: true
login:
path: /api/v1/login
controller: App\Controller\SecurityController::login
app_api_login:
path: /api/v1/login
methods: ['POST']
controller: App\Controller\ApiController::login
app_api_logout:
path: /api/v1/logout
methods: ['POST']
controller: App\Controller\ApiController::logout
app_api_show_info:
path: /api/v1
methods: ['GET']
controller: App\Controller\ApiController::showVersionInfo
app_api_list_users:
path: /api/v1/users
methods: ['GET']
controller: App\Controller\ApiController::listUsers
logout:
path: /api/v1/logout