symfony / maker-bundle

Symfony Maker Bundle
https://symfony.com/
MIT License
3.37k stars 404 forks source link

make:auth should add access_control for the login path #396

Open nicolas-grekas opened 5 years ago

nicolas-grekas commented 5 years ago

That would be consistent with https://symfony.com/doc/current/security/form_login_setup.html

    access_control:
        - { path: ^/login$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
JJarrie commented 5 years ago

Hello Nicolas,

Fix this issue look like we need to change depth's rules for switching to inline struct into Symfony\Bundle\MakerBundle\Util\YamlSourceManipulator::convertToYaml() but doing this create some unexpected changes on others keys, for example:

security:
    encoders:
        App\Security\User: { algorithm: argon2i }

instead of

security:
    encoders:
        App\Security\User:
            algorithm: argon2i

I'm looking to track the type of value when we adding new key in file and do case by case rule (must be inline when value are array and parent are sequential array, imho), this is potentially Symfony\Component\Yaml\Dumper::dump() issue.