-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Security] [WIP] Add documentation for the Security Component #1604
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
[Security] [WIP] Add documentation for the Security Component #1604
Conversation
|
||
class SomeAuthenticationListener implements ListenerInterface | ||
{ | ||
/* @var SecurityContextInterface */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be:
/**
* @var SecurityContextInterface
*/
As well as the other examples
@wouterj Thanks for your feedback! Do you have a reference page for the commenting style? I could probably do this right the first time ;) |
@matthiasnoback The documentation standards are just merged in the documentation. You can read it here: https://github.com/symfony/symfony-docs/blob/master/contributing/documentation/overview.rst#standards (it doesn't appear at the symfony website...) |
==================== | ||
|
||
Central to the Security Component is the security context, which is an instance | ||
of :class:`Symfony\\Component\\Security\\Core\\SecurityContext`. When all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess SecurityContextInterface
would be even better :)
I have made the necessary changes based on all of the above comments, and also added the third part of the docs, about authorization. Still a work in progress, any comments are very welcome... |
an authenticated token when the supplied credentials were found to be valid. | ||
The listener should then store the authenticated token in the security context: | ||
|
||
:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should use ::
at the end of the previous paragraph instead
to create a hash of the password and returns an authenticated token if the | ||
password was valid. | ||
|
||
:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use the ::
shorthand if you don't want to put a :
after the sentence, use the .. code-block:: php
instead. The ::
will be replaced with :
and the indented text after it will be seen as code.
You haven't understood the
You should use:
This is equal on the screen, the You should use the normal code-block syntax in every other situation. I have marked some, but fix the others as well. |
I have been thinking about this pull request: it is time to merge and close for now. I have been struggling with the still missing ACL part, and especially with the question how I could add anything interesting complementary to what can be found about ACL in the relevant Cookbook articles. Also, what I have been written can be (and has proven to be) useful for Symfony users, so I will finish my work this week. Let this get out in the open (so others may contribute to it). |
@matthiasnoback big +1! Additional details and updates can be added later, as soon as we merge, people will start to add and correct things, which is awesome! As far as ACL, probably the cookbook would need to eventually be moved into a secondary component doc in the security section (I don't think it really has anything to do with the framework). But, that can come later. Ping back when you've rebased and done your final work. Thanks for taking this on! |
about firewall, firewall map, firewall listeners, authentication manager, password encoder factory, password encoders, user providers
Thanks, Ryan. Well, this is it then. I've rebased my branch and it should be ready to be merged (all feedback has been taken into account). |
$unauthenticatedToken = new UsernamePasswordToken( | ||
$username, | ||
$password, | ||
$this->providerKey); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be:
$this->providerKey
);
Great job @matthiasnoback! I have done a last check and found some errors. I prefer to add the long roles ( |
Thanks you too @wouterj! I also prefer shorter lines, but changing them all to comply with the 80 characters rule is too much I think: many times these |
…entation [Security] [WIP] Add documentation for the Security Component
This is a work in progress - I am writing documentation for the Security Component.
My goals:
Though the documentation is still in a very early stage, I already send this pull request, so everyone knows I'm working on it (and maybe there are some people who would like to collaborate, since this appears to be quite an undertaking...).
Any suggestions are welcome by the way!