mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:27:42 +00:00
feat: mfa policy (#913)
* feat: add mfa to login policy * feat: add mfa to login policy * feat: add mfa to login policy * feat: add mfa to login policy * feat: add mfa to login policy on org * feat: add mfa to login policy on org * feat: append events on policy views * feat: iam login policy mfa definition * feat: login policies on orgs * feat: configured mfas in login process * feat: configured mfas in login process * Update internal/ui/login/static/i18n/en.yaml Co-authored-by: Livio Amstutz <livio.a@gmail.com> * fix: rename software and hardware mfas * fix: pr requests * fix user mfa * fix: test * fix: oidc version * fix: oidc version * fix: proto gen Co-authored-by: Livio Amstutz <livio.a@gmail.com> Co-authored-by: Max Peintner <max@caos.ch>
This commit is contained in:
@@ -34,7 +34,7 @@ type AuthRequest struct {
|
||||
LinkingUsers []*ExternalUser
|
||||
PossibleSteps []NextStep
|
||||
PasswordVerified bool
|
||||
MfasVerified []MfaType
|
||||
MfasVerified []MFAType
|
||||
Audience []string
|
||||
AuthTime time.Time
|
||||
Code string
|
||||
@@ -109,7 +109,7 @@ func (a *AuthRequest) IsValid() bool {
|
||||
a.Request != nil && a.Request.IsValid()
|
||||
}
|
||||
|
||||
func (a *AuthRequest) MfaLevel() MfaLevel {
|
||||
func (a *AuthRequest) MfaLevel() MFALevel {
|
||||
return -1
|
||||
//PLANNED: check a.PossibleLOAs (and Prompt Login?)
|
||||
}
|
||||
|
@@ -155,7 +155,7 @@ func TestAuthRequest_MfaLevel(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
fields fields
|
||||
want MfaLevel
|
||||
want MFALevel
|
||||
}{
|
||||
//PLANNED: Add / replace test cases when LOA is set
|
||||
{"-1",
|
||||
@@ -170,7 +170,7 @@ func TestAuthRequest_MfaLevel(t *testing.T) {
|
||||
PossibleLOAs: tt.fields.PossibleLOAs,
|
||||
}
|
||||
if got := a.MfaLevel(); got != tt.want {
|
||||
t.Errorf("MfaLevel() = %v, want %v", got, tt.want)
|
||||
t.Errorf("MFALevel() = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@@ -107,7 +107,7 @@ func (s *VerifyEMailStep) Type() NextStepType {
|
||||
|
||||
type MfaPromptStep struct {
|
||||
Required bool
|
||||
MfaProviders []MfaType
|
||||
MfaProviders []MFAType
|
||||
}
|
||||
|
||||
func (s *MfaPromptStep) Type() NextStepType {
|
||||
@@ -115,7 +115,7 @@ func (s *MfaPromptStep) Type() NextStepType {
|
||||
}
|
||||
|
||||
type MfaVerificationStep struct {
|
||||
MfaProviders []MfaType
|
||||
MfaProviders []MFAType
|
||||
}
|
||||
|
||||
func (s *MfaVerificationStep) Type() NextStepType {
|
||||
@@ -140,17 +140,18 @@ func (s *RedirectToCallbackStep) Type() NextStepType {
|
||||
return NextStepRedirectToCallback
|
||||
}
|
||||
|
||||
type MfaType int
|
||||
type MFAType int
|
||||
|
||||
const (
|
||||
MfaTypeOTP MfaType = iota
|
||||
MFATypeOTP MFAType = iota
|
||||
MFATypeU2F
|
||||
)
|
||||
|
||||
type MfaLevel int
|
||||
type MFALevel int
|
||||
|
||||
const (
|
||||
MfaLevelNotSetUp MfaLevel = iota
|
||||
MfaLevelSoftware
|
||||
MfaLevelHardware
|
||||
MfaLevelHardwareCertified
|
||||
MFALevelNotSetUp MFALevel = iota
|
||||
MFALevelSecondFactor
|
||||
MFALevelMultiFactor
|
||||
MFALevelMultiFactorCertified
|
||||
)
|
||||
|
Reference in New Issue
Block a user