Skip to content

Standardize form validation for WebauthnSetupForm#10782

Merged
aduth merged 2 commits intomainfrom
aduth-standard-webauthn-setup-form
Jun 21, 2024
Merged

Standardize form validation for WebauthnSetupForm#10782
aduth merged 2 commits intomainfrom
aduth-standard-webauthn-setup-form

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Jun 7, 2024

🛠 Summary of changes

Refactors WebauthnSetupForm to validate parameters in a standardized manner:

  • submit accepts a single hash of parameters
  • Use ActiveModel::Model validation methods (validates, etc.) to add errors
  • Success is based on ActiveModel::Model#valid? alone

This originally started with a desire to replace the ad hoc webauthn_setup_submitted with multi_factor_auth_setup, which then led to the realization that setups can happen through multiple pathways and forms (WebauthnSetupForm and WebauthnVisitForm). The changes here are intended to standardize behaviors in WebauthnSetupForm to help prepare for the next step of merging WebauthnSetupForm and WebauthnVisitForm.

📜 Testing Plan

Verify there are no regressions in the setup of a Face or Touch Unlock or Security Key MFA method.

Verify that tests pass:

rspec spec/forms/webauthn_setup_form_spec.rb

@aduth aduth requested a review from a team June 7, 2024 19:45
aduth added 2 commits June 21, 2024 08:32
changelog: Internal, WebAuthn, Standardize form validation for WebauthnSetupForm
@aduth aduth force-pushed the aduth-standard-webauthn-setup-form branch from 04bbfcf to 3a19e1f Compare June 21, 2024 12:35
@aduth aduth merged commit 7b73544 into main Jun 21, 2024
@aduth aduth deleted the aduth-standard-webauthn-setup-form branch June 21, 2024 13:51
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.

2 participants