This commit is contained in:
2024-12-26 17:45:58 +01:00
parent 9a2e4755e1
commit 4b798fd1f9
39 changed files with 1445 additions and 71 deletions

View File

@ -1,4 +1,6 @@
oneup_uploader:
mappings:
avatar:
frontend: dropzone
frontend: dropzone
logo:
frontend: dropzone

View File

@ -1,21 +1,24 @@
security:
# https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords
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:
sql_provider:
entity:
class: App\Entity\User
property: username
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
lazy: true
provider: app_user_provider
pattern: ^/
provider: sql_provider
custom_authenticators:
- App\Security\DynamicAuthenticator
form_login:
login_path: app_login
check_path: app_login
@ -23,31 +26,15 @@ security:
default_target_path: /
logout:
path: app_logout
# where to redirect after logout
# target: app_any_route
# 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: ^/login, roles: PUBLIC_ACCESS }
- { path: ^/register, roles: PUBLIC_ACCESS }
- { path: ^/admin, roles: ROLE_ADMIN }
- { path: ^/, roles: ROLE_USER }
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

View File

@ -1,22 +1,23 @@
# 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:
appEnv: "%env(resolve:APP_ENV)%"
appSecret: "%env(resolve:APP_SECRET)%"
appName: "%env(resolve:APP_NAME)%"
appNoreply: "%env(resolve:APP_NOREPLY)%"
modeAuth: "%env(resolve:MODE_AUTH)%"
casHost: "%env(resolve:CAS_HOST)%"
casPort: "%env(resolve:CAS_PORT)%"
casPath: "%env(resolve:CAS_PATH)%"
casUsername: "%env(resolve:CAS_USERNAME)%"
casMail: "%env(resolve:CAS_MAIL)%"
casLastname: "%env(resolve:CAS_LASTNAME)%"
casFirstname: "%env(resolve:CAS_FIRSTNAME)%"
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
App\:
resource: "../src/"
exclude:
@ -30,4 +31,8 @@ services:
tags:
- name: "doctrine.event_listener"
event: "postPersist"
entity: 'App\Entity\Company'
entity: 'App\Entity\Company'
App\Security\DynamicAuthenticator:
arguments:
$modeAuth: '%env(MODE_AUTH)%'