-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
feat (2fa): Add IStatelessProvider interface #57216
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
base: master
Are you sure you want to change the base?
feat (2fa): Add IStatelessProvider interface #57216
Conversation
Signed-off-by: Michał Roszak <[email protected]>
| */ | ||
| interface IStatelessProvider extends IProvider { | ||
|
|
||
| public function isTwoFactorAuthEnabledForUser(IUser $user): bool; |
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.
| public function isTwoFactorAuthEnabledForUser(IUser $user): bool; |
Doesn't add anything sine this method is from the parent interface
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.
True. I added it, because i was concerned it may get removed from the IProvider interface in the future, since the DocBlock of the OC\Authentication\TwoFactorAuth\Manager::fixMissingProviderStates method says "todo: remove in Nextcloud 17 as by then all providers should have been updated" and it is the only usage of isTwoFactorAuthEnabledForUser method.
Anyway, i'm going to remove it from my interface, since there is no need for that at the moment.
| * for user will be checked dynamically and not stored in the database. | ||
| */ |
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.
| * for user will be checked dynamically and not stored in the database. | |
| */ | |
| * for user will be checked dynamically and not stored in the database. | |
| * @since 33.0.0 | |
| */ | |
| #[Implementable(since: '33.0.0')] |
Signed-off-by: Michał Roszak <[email protected]>
Summary
Adds an
IStatelessProviderinterface. Per-user 2FA activation state for providers implementing this interface will not be stored in the database, thusisTwoFactorAuthEnabledForUsermethod will be called on every login attempt.Checklist
3. to review, feature component)stable32)