Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[make:security:form-login] new maker to use built in FormLogin #1244

Merged
merged 23 commits into from
Nov 30, 2022

Conversation

jrushlow
Copy link
Collaborator

@jrushlow jrushlow commented Nov 29, 2022

Introduces a new series of makers that use the built-in SecurityBundle authenticators. The first - make:security:form-login with the next probably being make:security:json-login ? which will abstract any common functionality that make:security:* can re-use...

This PR does not deprecate make:auth yet. Once we have a make:security:custom-authenticator in place - we can sunset make:auth.

  • Update docs to show usage and examples

fixes #1049


@wouterj - Im going to steal some of the concepts/code from #1058 so we can implement that PR in baby steps - starting with FormLogin

@jrushlow jrushlow added Feature New Feature Status: Needs Work Additional work is needed labels Nov 29, 2022
@jrushlow jrushlow changed the title WIP - [make:security:form-login] new maker to use built in FormLogin [make:security:form-login] new maker to use built in FormLogin Nov 29, 2022
@jrushlow jrushlow marked this pull request as ready for review November 29, 2022 11:24
@jrushlow jrushlow added Status: Needs Review Needs to be reviewed and removed Status: Needs Work Additional work is needed labels Nov 29, 2022
Copy link
Member

@weaverryan weaverryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really, really nice work - congrats ❤️

src/Maker/Security/MakeFormLogin.php Show resolved Hide resolved
src/Maker/Security/MakeFormLogin.php Outdated Show resolved Hide resolved
src/Resources/help/security/MakeFormLogin.txt Outdated Show resolved Hide resolved
src/Resources/help/security/MakeFormLogin.txt Outdated Show resolved Hide resolved
src/Maker/Security/MakeFormLogin.php Outdated Show resolved Hide resolved
src/Security/SecurityConfigUpdater.php Outdated Show resolved Hide resolved
src/Security/SecurityConfigUpdater.php Show resolved Hide resolved
tests/Maker/FunctionalTest.php Outdated Show resolved Hide resolved

$form->setValues([
'_username' => 'jr@rushlow.dev',
'_password' => 'badPass',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I misread this originally. I thought you were logging in as jr@rushlow.dev, password badass 😆

jrushlow and others added 8 commits November 29, 2022 10:51
Co-authored-by: Ryan Weaver <weaverryan+github@gmail.com>
Co-authored-by: Ryan Weaver <weaverryan+github@gmail.com>
Co-authored-by: Ryan Weaver <weaverryan+github@gmail.com>

/**
* @legacy This can be removed once we deprecate/remove `make:auth`
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's not technically true. It's just that once we remove make:auth, this won't NEED to be in a private method anymore. I'd remove this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The private method shouldn't be needed anymore here. We have a public updateForLogout() that this logic will be moved to.

@jrushlow jrushlow added Status: Reviewed Has been reviewed by a maintainer and removed Status: Needs Review Needs to be reviewed labels Nov 30, 2022
@jrushlow jrushlow merged commit a5d8b54 into symfony:main Nov 30, 2022
@jrushlow jrushlow deleted the feature/form-login branch November 30, 2022 11:13
@jrushlow jrushlow mentioned this pull request May 23, 2023
weaverryan added a commit that referenced this pull request Jun 7, 2023
This PR was merged into the 1.0-dev branch.

Discussion
----------

[git-released] v1.49.0

# Changelog

## [v1.49.0](https://github.com/symfony/maker-bundle/releases/tag/v1.49.0)

*Jun 7th, 2023*

### Feature

- [#1321](#1321) - Changing make:stimulus-controller to require StimulusBundle - *`@weaverryan`*
- [#1309](#1309) - Apply `get_class_to_class_keyword` PHP-CS-Fixer rule - *`@seb`-jean*
- [#1276](#1276) - [make:migration] Change message when required package for migration doesn't exist. - *`@bdaler`*
- [#1261](#1261) - [make:registration-form] use UniqueEntity attribute instead of annotation - *`@jrushlow`*
- [#1253](#1253) - [make:migration] Add link to new migration files - *`@nicolas`-grekas*
- [#1251](#1251) - [make:*] use php-cs-fixer to style/lint all generated php templates - *`@jrushlow`*
- [#1244](#1244) - [make:security:form-login] new maker to use built in FormLogin - *`@jrushlow`*
- [#1242](#1242) - [make:*] use static return type instead of self for setters - *`@jrushlow`*
- [#1239](#1239) - Improve error messages to show PHP & XML configurations are not supported - *`@ThomasLandauer`*
- [#1238](#1238) - [make:*] improve output messages for Symfony CLI users - *`@jrushlow`*
- [#1237](#1237) - [make:registration-form] Print registration form errors - *`@comxd`*
### Bug

- [#1307](#1307) - [make:twig-component] handle upstream changes to how live components are rendered - *`@jrushlow`*
- [#1270](#1270) - [make:authenticator] Core\Security or SecurityBundle\Security - Avoid deprecations in 6.2 - *`@nacorp`*
- [#1265](#1265) - [make:crud] Make sensio/framework-extra-bundle an optional dependency - *`@acrobat`*
- [#1264](#1264) - [make:controller] doctrine/annotations is not needed - *`@jrushlow`*
- [#1262](#1262) - [make:reset-password] doctrine/annotations are not needed - *`@jrushlow`*

_Generated by Git Released_

Commits
-------

a7bb5c6 Updating date, adding 1 more PR
cb06c33 [release] v1.49.0
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Jan 23, 2024
…le in MakerBundle (jrushlow)

This PR was squashed before being merged into the 5.4 branch.

Discussion
----------

[Security] WIP -  make:security:form-login is now available in MakerBundle

MakerBundle is going to introduce a new command to generate and configure the files needed for `FormLogin` in SecurityBundle.

Not sure if we should completely remove the "manual" howto in the docs or go with something like I have here.

Note: Command name and output subject to change until we merge, I'll update this PR accordingly. In the meantime, feedback welcomed!

Note: Additional `make:security:*` commands to follow shortly.

## Blockers:

- [x] Merge symfony/maker-bundle#1244
- [ ] Release MakerBundle `1.49.0`

Commits
-------

a6b2fd0 [Security] WIP -  make:security:form-login is now available in MakerBundle
@jrushlow jrushlow mentioned this pull request Apr 21, 2024
1 task
@fabpot
Copy link
Member

fabpot commented Apr 21, 2024

@jrushlow I've just updated the book, so it will use the new command in the 6.4 version of the book, to be released soon. Thank you for the ping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New Feature Status: Reviewed Has been reviewed by a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Security] make:auth should default to *not* implementing custom authenticators
3 participants