Skip to content

Commit

Permalink
fix: default MFAFactorType to false
Browse files Browse the repository at this point in the history
  • Loading branch information
J0 committed Sep 11, 2024
1 parent 89204b8 commit c00ca00
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions internal/conf/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,18 @@ type MFAFactorTypeConfiguration struct {
VerifyEnabled bool `json:"verify_enabled" split_words:"true" default:"false"`
}

type TOTPFactorTypeConfiguration struct {
EnrollEnabled bool `json:"enroll_enabled" split_words:"true" default:"true"`
VerifyEnabled bool `json:"verify_enabled" split_words:"true" default:"true"`
}

type PhoneFactorTypeConfiguration struct {
// Default to false in order to ensure Phone MFA is opt-in
EnrollEnabled bool `json:"enroll_enabled" split_words:"true" default:"false"`
VerifyEnabled bool `json:"verify_enabled" split_words:"true" default:"false"`
OtpLength int `json:"otp_length" split_words:"true"`
SMSTemplate *template.Template `json:"-"`
MaxFrequency time.Duration `json:"max_frequency" split_words:"true"`
Template string `json:"template"`
MFAFactorTypeConfiguration
OtpLength int `json:"otp_length" split_words:"true"`
SMSTemplate *template.Template `json:"-"`
MaxFrequency time.Duration `json:"max_frequency" split_words:"true"`
Template string `json:"template"`
}

// MFAConfiguration holds all the MFA related Configuration
Expand All @@ -133,7 +137,7 @@ type MFAConfiguration struct {
MaxEnrolledFactors float64 `split_words:"true" default:"10"`
MaxVerifiedFactors int `split_words:"true" default:"10"`
Phone PhoneFactorTypeConfiguration `split_words:"true"`
TOTP MFAFactorTypeConfiguration `split_words:"true" default:"{\"enroll_enabled\":true,\"verify_enabled\":true}"`
TOTP TOTPFactorTypeConfiguration `split_words:"true"`
WebAuthn MFAFactorTypeConfiguration `split_words:"true"`
}

Expand Down

0 comments on commit c00ca00

Please sign in to comment.