mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-16 04:48:04 +00:00
1c59d18fee
* add csrf * caching * caching * caching * caching * security headers * csp and security headers * error handler csp * select user with display name * csp * user selection styling * username to loginname * regenerate grpc * regenerate * change to login name
120 lines
2.0 KiB
Go
120 lines
2.0 KiB
Go
package model
|
|
|
|
type NextStep interface {
|
|
Type() NextStepType
|
|
}
|
|
|
|
type NextStepType int32
|
|
|
|
const (
|
|
NextStepUnspecified NextStepType = iota
|
|
NextStepLogin
|
|
NextStepUserSelection
|
|
NextStepInitUser
|
|
NextStepPassword
|
|
NextStepChangePassword
|
|
NextStepInitPassword
|
|
NextStepVerifyEmail
|
|
NextStepMfaPrompt
|
|
NextStepMfaVerify
|
|
NextStepRedirectToCallback
|
|
)
|
|
|
|
type UserSessionState int32
|
|
|
|
const (
|
|
UserSessionStateActive UserSessionState = iota
|
|
UserSessionStateTerminated
|
|
)
|
|
|
|
type LoginStep struct{}
|
|
|
|
func (s *LoginStep) Type() NextStepType {
|
|
return NextStepLogin
|
|
}
|
|
|
|
type SelectUserStep struct {
|
|
Users []UserSelection
|
|
}
|
|
|
|
func (s *SelectUserStep) Type() NextStepType {
|
|
return NextStepUserSelection
|
|
}
|
|
|
|
type UserSelection struct {
|
|
UserID string
|
|
DisplayName string
|
|
LoginName string
|
|
UserSessionState UserSessionState
|
|
}
|
|
|
|
type InitUserStep struct {
|
|
PasswordSet bool
|
|
}
|
|
|
|
func (s *InitUserStep) Type() NextStepType {
|
|
return NextStepInitUser
|
|
}
|
|
|
|
type PasswordStep struct{}
|
|
|
|
func (s *PasswordStep) Type() NextStepType {
|
|
return NextStepPassword
|
|
}
|
|
|
|
type ChangePasswordStep struct{}
|
|
|
|
func (s *ChangePasswordStep) Type() NextStepType {
|
|
return NextStepChangePassword
|
|
}
|
|
|
|
type InitPasswordStep struct{}
|
|
|
|
func (s *InitPasswordStep) Type() NextStepType {
|
|
return NextStepInitPassword
|
|
}
|
|
|
|
type VerifyEMailStep struct{}
|
|
|
|
func (s *VerifyEMailStep) Type() NextStepType {
|
|
return NextStepVerifyEmail
|
|
}
|
|
|
|
type MfaPromptStep struct {
|
|
Required bool
|
|
MfaProviders []MfaType
|
|
}
|
|
|
|
func (s *MfaPromptStep) Type() NextStepType {
|
|
return NextStepMfaPrompt
|
|
}
|
|
|
|
type MfaVerificationStep struct {
|
|
MfaProviders []MfaType
|
|
}
|
|
|
|
func (s *MfaVerificationStep) Type() NextStepType {
|
|
return NextStepMfaVerify
|
|
}
|
|
|
|
type RedirectToCallbackStep struct{}
|
|
|
|
func (s *RedirectToCallbackStep) Type() NextStepType {
|
|
return NextStepRedirectToCallback
|
|
}
|
|
|
|
type MfaType int
|
|
|
|
const (
|
|
MfaTypeOTP MfaType = iota
|
|
)
|
|
|
|
type MfaLevel int
|
|
|
|
const (
|
|
MfaLevelNotSetUp MfaLevel = iota
|
|
MfaLevelSoftware
|
|
MfaLevelHardware
|
|
MfaLevelHardwareCertified
|
|
)
|