-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Security] Add an interface for security passports which support attributes #42181
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
Conversation
5a7bdd4
to
3edd5e3
Compare
3edd5e3
to
a8aa89a
Compare
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.
Thanks for submitting a patch! I have one reservation here, which doesn't have anything to do with the work you've done: Originally, there was a discussion about whether we should add an interface for passports (which is nothing more than a value object). I managed to convince people by saying "I want to refactor the In other words: I think we maybe should deprecate the |
I would keep About the proposed extension, I tend to think we'd better add those methods to (sorry for the close/reopen, messed up with my keyboard) |
The more I think about this suggestion, the more I start to think it actually makes the most sense. At the root of this (and why I think the methods do need to be part of the interface, somehow), I know that the 5.3 compatible authenticators in So, maybe the better approach is to add the attribute methods to the main |
The one from scheb/2fa actually predates passport attributes (Christian did lots of work back in 5.1 to integrate the new system, while attributes were added "only" in 5.2). The needs of the special passport are now replaced by using attributes and I'll open an issue in that repository about deprecating the custom passport. I really don't see a need to customize the passport. It has 2 very generic methods to store data: either the data is important for authentication - stored in a badge; or the data is just transported - key-value store using attributes. |
Makes sense :) Custom badges are a better extension point and removes the need for custom passports. Let's burninate it! |
Closing as discussed, thanks for raising @mbabker! |
This PR was merged into the 5.4 branch. Discussion ---------- [Security] Deprecate `PassportInterface` | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no | Deprecations? | yes | Tickets | - | License | MIT | Doc PR | - As explained in #42181, the right extension point is badges, not passports. Also renames `AuthenticatorInterface::createAuthenticatedToken()` to `createToken()` because of the signature change and the recent abandon of the `authenticated` state for tokens. Commits ------- a446030 [Security] Deprecate `PassportInterface`
Right now, attributes for security passports can't be relied upon as they don't exist in the interface, so to use them you effectively have to type check the concrete Passport class. This proposes an interface exposing the attributes API from the Passport class which can make the feature more reliable without expecting concrete classes.