Conversation
|
Thank you for submitting PR. You can keep the PR open to gather feedback from the community, or it might be better to inform them on the forum or Slack. |
|
With all due respect, given that your PRs are quite large, I kindly suggest using the atomic commit approach. This will make the review process easier and faster for others. Smaller, more focused commits allow the team to review changes more efficiently. Additionally, if possible, please consider writing your commit messages in a way that provides a clear and concise explanation of the changes. |
|
I'm afraid that a breaking change at this stage of the library (in v1) is not an option. We can improve the way we handle actions, but it must be an evolution, not a revolution. |
MFA options for Shield: four packages from Cloud RepublicHi all, Following the discussion on this PR and in #1120 about extending 2FA in Shield, I wanted to share some work that may help. Without touching Shield's core, we've built and released four MFA packages for Shield. They work with the existing Actions system, so there are no breaking changes.
The dispatcher covers a lot of what this PR is aiming for (multiple active MFA methods and per-user choice) without a schema change to the users table or any breaking API changes. Details
Links
Feedback, issues and PRs are very welcome, especially from anyone with a use case the dispatcher doesn't cover yet. If there are gaps that would make more sense in Shield itself, I'd be happy to help work out a non-breaking way to do it. Thanks! |
|
@cloudrepublic-steve Thank you for sharing the packages. If possible, please also share them in the Discussions section. |
Will do! I added a comment into the general CI forum but wasn't sure if that was the right place for it but there were a few other comments regarding Shield so posted it there anyway. I'll update the shield discussion topic now. Thanks |
Although Shield currently offers 2FA, its support is somewhat limited. Like this discussion #1120, I also feel that it could benefit from a more robust system, like supporting multiple 2FA systems, allowing global/per user 2FA, or setting custom 2FA actions per user group, like suggested in discussions.
I would love to know what you think.
Description
This PR expands support of 2FA actions for Shield. It allows having multiple active 2FA methods, per-user or site-wide 2FA, per-group custom 2FA action, and a default. The settings
$Mfa,$forceMfa,$actionsMfa,$defaultMfaand$matrixMfaare introduced to theAuthconfig file to control these settings. The per-user 2FA is achieved through a new column namedmfain the user table acting as a flag. TheUserEntity introduces theisMfaActive() :boolmethod for easy access to the property.Within the
Authenticators/Session.php:511, currently, theauth_action_messageis being assigned the extra field directly. Expanding the 2FA actions, that extra field may be useful to store data related to the identity, so theActionInterfaceintroduces thegetActionMessage() :stringmethod to get thisauth_action_messagevalue from the action.These changes introduce breaking changes to past versions.
Implements #1120
Checklist: