Skip to content

LG-13872: MFA Setup Constraint removal for restricting SP on second MFA addition. #11029

Merged
mdiarra3 merged 7 commits intomainfrom
LG-13872-mfa-setup-constraints
Aug 7, 2024
Merged

LG-13872: MFA Setup Constraint removal for restricting SP on second MFA addition. #11029
mdiarra3 merged 7 commits intomainfrom
LG-13872-mfa-setup-constraints

Conversation

@mdiarra3
Copy link
Contributor

@mdiarra3 mdiarra3 commented Aug 5, 2024

🎫 Ticket

Link to the relevant ticket:
LG-13872

🛠 Summary of changes

This fixes it so that users that have a piv or phishing resistance requirement by SP are not hampered from adding a secondary MFA method after selecting those methods.

📜 Testing Plan

Provide a checklist of steps to confirm the changes.

  • User created by going through a SP will be allowed to see.
  • User that didnt have phishing resistant requirements for SP, has new SP requiring Phising or PIV requirements, and would be listed with Phishing or PIV options.

@mdiarra3 mdiarra3 marked this pull request as ready for review August 5, 2024 21:12
@mdiarra3 mdiarra3 requested a review from aduth August 6, 2024 12:56
@aduth aduth requested a review from a team August 6, 2024 13:00
Copy link
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion for code organization, but tests well and otherwise LGTM 👍

Comment on lines +71 to +79
def phishing_resistant?
service_provider_mfa_policy.phishing_resistant_required? &&
!mfa_context.phishing_resistant_configurations.present?
end

def piv_cac_required?
service_provider_mfa_policy.piv_cac_required? &&
!mfa_context.piv_cac_configurations.present?
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kinda feel like it might be better for this logic to live inside the presenter class, since that helps keep the controller leaner, and we can more easily add tests for it there. We also already have mfa_policy inside TwoFactorOptionsPresenter, which we can use phishing_resistant_mfa_enabled? from.

MfaPolicy doesn't have an equivalent to checking if PIV/CAC configuration exists, but maybe we could add a method, or create mfa_context inside TwoFactorOptionsPresenter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm yea I can update to address,

Copy link
Contributor

@kevinsmaster5 kevinsmaster5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG & checks out with local testing 👍

Copy link
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mdiarra3 mdiarra3 merged commit bba83e1 into main Aug 7, 2024
@mdiarra3 mdiarra3 deleted the LG-13872-mfa-setup-constraints branch August 7, 2024 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants