model

package
v1.84.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OrgDomainPrimaryScope = "urn:zitadel:iam:org:domain:primary:"
	OrgDomainPrimaryClaim = "urn:zitadel:iam:org:domain:primary"
	ProjectIDScope        = "urn:zitadel:iam:org:project:id:"
	AudSuffix             = ":aud"
	SelectIDPScope        = "urn:zitadel:iam:org:idp:id:"
)

Variables

This section is empty.

Functions

func MFALevelToDomain

func MFALevelToDomain(mfaLevel MFALevel) domain.MFALevel

func MFATypeToDomain

func MFATypeToDomain(mfaType MFAType) domain.MFAType

func UserSessionStateToDomain

func UserSessionStateToDomain(state UserSessionState) domain.UserSessionState

Types

type AuthRequest

type AuthRequest struct {
	ID            string
	AgentID       string
	CreationDate  time.Time
	ChangeDate    time.Time
	BrowserInfo   *BrowserInfo
	ApplicationID string
	CallbackURI   string
	TransferState string
	Prompt        Prompt
	PossibleLOAs  []LevelOfAssurance
	UiLocales     []string
	LoginHint     string
	MaxAuthAge    uint32
	Request       Request

	UserID                 string
	UserName               string
	LoginName              string
	DisplayName            string
	UserOrgID              string
	RequestedOrgID         string
	RequestedOrgName       string
	RequestedPrimaryDomain string
	SelectedIDPConfigID    string
	LinkingUsers           []*ExternalUser
	PossibleSteps          []NextStep
	PasswordVerified       bool
	MFAsVerified           []MFAType
	Audience               []string
	AuthTime               time.Time
	Code                   string
	LoginPolicy            *model.LoginPolicyView
	LabelPolicy            *model.LabelPolicyView
	AllowedExternalIDPs    []*model.IDPProviderView
	// contains filtered or unexported fields
}

func NewAuthRequest

func NewAuthRequest(id, agentID string, info *BrowserInfo, applicationID, callbackURI, transferState string,
	prompt Prompt, possibleLOAs []LevelOfAssurance, uiLocales []string, loginHint, preselectedUserID string, maxAuthAge uint32, request Request) *AuthRequest

func NewAuthRequestFromType

func NewAuthRequestFromType(requestType AuthRequestType) (*AuthRequest, error)

func (*AuthRequest) AppendAudIfNotExisting

func (a *AuthRequest) AppendAudIfNotExisting(aud string)

func (*AuthRequest) GetScopeOrgPrimaryDomain

func (a *AuthRequest) GetScopeOrgPrimaryDomain() string

func (*AuthRequest) GetScopeProjectIDsForAud

func (a *AuthRequest) GetScopeProjectIDsForAud() []string

func (*AuthRequest) IsValid

func (a *AuthRequest) IsValid() bool

func (*AuthRequest) MFALevel

func (a *AuthRequest) MFALevel() MFALevel

func (*AuthRequest) SetUserInfo

func (a *AuthRequest) SetUserInfo(userID, userName, loginName, displayName, userOrgID string)

func (*AuthRequest) WithCurrentInfo

func (a *AuthRequest) WithCurrentInfo(info *BrowserInfo) *AuthRequest

type AuthRequestOIDC

type AuthRequestOIDC struct {
	Scopes        []string
	ResponseType  OIDCResponseType
	Nonce         string
	CodeChallenge *OIDCCodeChallenge
}

func (*AuthRequestOIDC) IsValid

func (a *AuthRequestOIDC) IsValid() bool

func (*AuthRequestOIDC) Type

func (a *AuthRequestOIDC) Type() AuthRequestType

type AuthRequestSAML

type AuthRequestSAML struct {
}

func (*AuthRequestSAML) IsValid

func (a *AuthRequestSAML) IsValid() bool

func (*AuthRequestSAML) Type

func (a *AuthRequestSAML) Type() AuthRequestType

type AuthRequestType

type AuthRequestType int32
const (
	AuthRequestTypeOIDC AuthRequestType = iota
	AuthRequestTypeSAML
)

type BrowserInfo

type BrowserInfo struct {
	UserAgent      string
	AcceptLanguage string
	RemoteIP       net.IP
}

func BrowserInfoFromRequest

func BrowserInfoFromRequest(r *http.Request) *BrowserInfo

func (*BrowserInfo) IsValid

func (i *BrowserInfo) IsValid() bool

type ChangePasswordStep

type ChangePasswordStep struct{}

func (*ChangePasswordStep) Type

func (s *ChangePasswordStep) Type() NextStepType

type ChangeUsernameStep

type ChangeUsernameStep struct{}

func (*ChangeUsernameStep) Type

func (s *ChangeUsernameStep) Type() NextStepType

type ExternalLoginStep

type ExternalLoginStep struct {
	SelectedIDPConfigID string
}

func (*ExternalLoginStep) Type

func (s *ExternalLoginStep) Type() NextStepType

type ExternalNotFoundOptionStep

type ExternalNotFoundOptionStep struct{}

func (*ExternalNotFoundOptionStep) Type

type ExternalUser

type ExternalUser struct {
	IDPConfigID       string
	ExternalUserID    string
	DisplayName       string
	PreferredUsername string
	FirstName         string
	LastName          string
	NickName          string
	Email             string
	IsEmailVerified   bool
	PreferredLanguage language.Tag
	Phone             string
	IsPhoneVerified   bool
}

type GrantRequiredStep

type GrantRequiredStep struct{}

func (*GrantRequiredStep) Type

func (s *GrantRequiredStep) Type() NextStepType

type InitPasswordStep

type InitPasswordStep struct{}

func (*InitPasswordStep) Type

func (s *InitPasswordStep) Type() NextStepType

type InitUserStep

type InitUserStep struct {
	PasswordSet bool
}

func (*InitUserStep) Type

func (s *InitUserStep) Type() NextStepType

type LevelOfAssurance

type LevelOfAssurance int
const (
	LevelOfAssuranceNone LevelOfAssurance = iota
)

type LinkUsersStep

type LinkUsersStep struct{}

func (*LinkUsersStep) Type

func (s *LinkUsersStep) Type() NextStepType

type LoginStep

type LoginStep struct{}

func (*LoginStep) Type

func (s *LoginStep) Type() NextStepType

type MFALevel

type MFALevel int
const (
	MFALevelNotSetUp MFALevel = iota
	MFALevelSecondFactor
	MFALevelMultiFactor
	MFALevelMultiFactorCertified
)

type MFAPromptStep

type MFAPromptStep struct {
	Required     bool
	MFAProviders []MFAType
}

func (*MFAPromptStep) Type

func (s *MFAPromptStep) Type() NextStepType

type MFAType

type MFAType int
const (
	MFATypeOTP MFAType = iota
	MFATypeU2F
	MFATypeU2FUserVerification
)

type MFAVerificationStep

type MFAVerificationStep struct {
	MFAProviders []MFAType
}

func (*MFAVerificationStep) Type

type NextStep

type NextStep interface {
	Type() NextStepType
}

type NextStepType

type NextStepType int32
const (
	NextStepUnspecified NextStepType = iota
	NextStepLogin
	NextStepUserSelection
	NextStepInitUser
	NextStepPassword
	NextStepChangePassword
	NextStepInitPassword
	NextStepVerifyEmail
	NextStepMFAPrompt
	NextStepMFAVerify
	NextStepRedirectToCallback
	NextStepChangeUsername
	NextStepLinkUsers
	NextStepExternalNotFoundOption
	NextStepExternalLogin
	NextStepGrantRequired
	NextStepPasswordless
)

type OIDCCodeChallenge

type OIDCCodeChallenge struct {
	Challenge string
	Method    OIDCCodeChallengeMethod
}

func (*OIDCCodeChallenge) IsValid

func (c *OIDCCodeChallenge) IsValid() bool

type OIDCCodeChallengeMethod

type OIDCCodeChallengeMethod int32
const (
	CodeChallengeMethodPlain OIDCCodeChallengeMethod = iota
	CodeChallengeMethodS256
)

type OIDCResponseType

type OIDCResponseType int32
const (
	OIDCResponseTypeCode OIDCResponseType = iota
	OIDCResponseTypeIdToken
	OIDCResponseTypeIdTokenToken
)

type PasswordStep

type PasswordStep struct{}

func (*PasswordStep) Type

func (s *PasswordStep) Type() NextStepType

type PasswordlessStep

type PasswordlessStep struct{}

func (*PasswordlessStep) Type

func (s *PasswordlessStep) Type() NextStepType

type Prompt

type Prompt int32
const (
	PromptUnspecified Prompt = iota
	PromptNone
	PromptLogin
	PromptConsent
	PromptSelectAccount
)

type RedirectToCallbackStep

type RedirectToCallbackStep struct{}

func (*RedirectToCallbackStep) Type

type Request

type Request interface {
	Type() AuthRequestType
	IsValid() bool
}

type SelectUserStep

type SelectUserStep struct {
	Users []UserSelection
}

func (*SelectUserStep) Type

func (s *SelectUserStep) Type() NextStepType

type UserSelection

type UserSelection struct {
	UserID            string
	DisplayName       string
	UserName          string
	LoginName         string
	UserSessionState  UserSessionState
	SelectionPossible bool
}

type UserSessionState

type UserSessionState int32
const (
	UserSessionStateActive UserSessionState = iota
	UserSessionStateTerminated
)

type VerifyEMailStep

type VerifyEMailStep struct{}

func (*VerifyEMailStep) Type

func (s *VerifyEMailStep) Type() NextStepType

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL