mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-01 13:53:08 +00:00
* fix: move eventstore pkgs * fix: move eventstore pkgs * fix: remove v2 view * fix: remove v2 view
50 lines
1.0 KiB
Go
50 lines
1.0 KiB
Go
package domain
|
|
|
|
import "github.com/caos/zitadel/internal/eventstore/v1/models"
|
|
|
|
type LoginPolicy struct {
|
|
models.ObjectRoot
|
|
|
|
Default bool
|
|
AllowUsernamePassword bool
|
|
AllowRegister bool
|
|
AllowExternalIDP bool
|
|
IDPProviders []*IDPProvider
|
|
ForceMFA bool
|
|
SecondFactors []SecondFactorType
|
|
MultiFactors []MultiFactorType
|
|
PasswordlessType PasswordlessType
|
|
}
|
|
|
|
type IDPProvider struct {
|
|
models.ObjectRoot
|
|
Type IdentityProviderType
|
|
IDPConfigID string
|
|
|
|
Name string
|
|
StylingType IDPConfigStylingType
|
|
IDPConfigType IDPConfigType
|
|
IDPState IDPConfigState
|
|
}
|
|
|
|
type PasswordlessType int32
|
|
|
|
const (
|
|
PasswordlessTypeNotAllowed PasswordlessType = iota
|
|
PasswordlessTypeAllowed
|
|
|
|
passwordlessCount
|
|
)
|
|
|
|
func (f PasswordlessType) Valid() bool {
|
|
return f >= 0 && f < passwordlessCount
|
|
}
|
|
|
|
func (p *LoginPolicy) HasSecondFactors() bool {
|
|
return len(p.SecondFactors) > 0
|
|
}
|
|
|
|
func (p *LoginPolicy) HasMultiFactors() bool {
|
|
return len(p.MultiFactors) > 0
|
|
}
|