-
-
Notifications
You must be signed in to change notification settings - Fork 415
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
Adding a make:user command #250
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
efdf35d
to
3c6c8e0
Compare
I really like the idea! |
This is a micro-optimization that is likely not necessary in user-land code and could cause confusion if users aren't familiar.
Test failures are due to some unrelated deprecations and a pesky Windows false failure I'm debugging elsewhere :) |
weaverryan
added a commit
that referenced
this pull request
Aug 30, 2018
This PR was squashed before being merged into the 1.0-dev branch (closes #250). Discussion ---------- Adding a make:user command Hi guys! My latest experiment π¨π»βπ¬! **User is an Entity** <img width="1277" alt="screen shot 2018-08-28 at 2 16 20 pm" src="https://user-images.githubusercontent.com/121003/44742077-faa57d80-aacc-11e8-8f73-acce0b669c7a.png"> **User is a Model Class** <img width="1278" alt="screen shot 2018-08-28 at 2 11 38 pm" src="https://user-images.githubusercontent.com/121003/44742324-98994800-aacd-11e8-8ddd-8e52310dc61a.png"> This walks people through some of the most confusing parts of starting with Symfony's security so that they can get straight to writing authenticators. A) It can generate an **entity or non-entity** `User` class B) It sets up your **`User::getUsername()` method correctly**, which can be confusing... because often you don't have a username (e.g. you have an email) C) It correctly **fills in `getSalt()` and `getPassword()`** based on whether or not your app actually *needs* to check passwords D) It **updates** the `providers` and `encoders` sections in **`security.yaml` file without losing formatting or comments**. If this process fails (it's not perfect), the command will tell you exactly what YAML to update. It defaults to using `argon2i` when the system supports it. Example generated `User` class source: `tests/Security/fixtures/expected/*` Example generated `security.yaml` source: `tests/Security/yaml_fixtures/expected_user_class/`* I'd love to have feedback from people trying it. You should be able to switch to the `dev-make-user` branch of this repository to get it. Cheers! Commits ------- c5fb5df more phpcs fixing 603a815 reducing length of unique field to avoid index length problems f6e273a Not requiring \in_array() style on generated code 23116fa bumping MySQL sever_version to 5.6 to fix Travis & JSON fields 3a40c86 updating to latest phpcs c44b1d5 Getting info about cs problems 93a846d Adding make:user command
@weaverryan the branch should be removed ;-) |
This was referenced Jan 10, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi guys!
My latest experiment π¨π»βπ¬!
User is an Entity
![screen shot 2018-08-28 at 2 16 20 pm](https://user-images.githubusercontent.com/121003/44742077-faa57d80-aacc-11e8-8f73-acce0b669c7a.png)
User is a Model Class
![screen shot 2018-08-28 at 2 11 38 pm](https://user-images.githubusercontent.com/121003/44742324-98994800-aacd-11e8-8ddd-8e52310dc61a.png)
This walks people through some of the most confusing parts of starting with Symfony's security so that they can get straight to writing authenticators.
A) It can generate an entity or non-entity
User
classB) It sets up your
User::getUsername()
method correctly, which can be confusing... because often you don't have a username (e.g. you have an email)C) It correctly fills in
getSalt()
andgetPassword()
based on whether or not your app actually needs to check passwordsD) It updates the
providers
andencoders
sections insecurity.yaml
file without losing formatting or comments. If this process fails (it's not perfect), the command will tell you exactly what YAML to update. It defaults to usingargon2i
when the system supports it.Example generated
User
class source:tests/Security/fixtures/expected/*
Example generated
security.yaml
source:tests/Security/yaml_fixtures/expected_user_class/
*I'd love to have feedback from people trying it. You should be able to switch to the
dev-make-user
branch of this repository to get it.Cheers!