model

package
v1.87.5 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	es_models.ObjectRoot

	Country       string
	Locality      string
	PostalCode    string
	Region        string
	StreetAddress string
}

type Email

type Email struct {
	es_models.ObjectRoot

	EmailAddress    string
	IsEmailVerified bool
}

func (*Email) GenerateEmailCodeIfNeeded

func (e *Email) GenerateEmailCodeIfNeeded(emailGenerator crypto.Generator) (*EmailCode, error)

func (*Email) IsValid

func (e *Email) IsValid() bool

type EmailCode

type EmailCode struct {
	es_models.ObjectRoot

	Code   *crypto.CryptoValue
	Expiry time.Duration
}

func (*EmailCode) GenerateEmailCode

func (code *EmailCode) GenerateEmailCode(emailGenerator crypto.Generator) error

type ExternalIDP

type ExternalIDP struct {
	es_models.ObjectRoot

	IDPConfigID string
	UserID      string
	DisplayName string
}

func (*ExternalIDP) IsValid

func (idp *ExternalIDP) IsValid() bool

type ExternalIDPSearchKey

type ExternalIDPSearchKey int32
const (
	ExternalIDPSearchKeyUnspecified ExternalIDPSearchKey = iota
	ExternalIDPSearchKeyExternalUserID
	ExternalIDPSearchKeyUserID
	ExternalIDPSearchKeyIdpConfigID
	ExternalIDPSearchKeyResourceOwner
)

type ExternalIDPSearchQuery

type ExternalIDPSearchQuery struct {
	Key    ExternalIDPSearchKey
	Method domain.SearchMethod
	Value  interface{}
}

type ExternalIDPSearchRequest

type ExternalIDPSearchRequest struct {
	Offset        uint64
	Limit         uint64
	SortingColumn ExternalIDPSearchKey
	Asc           bool
	Queries       []*ExternalIDPSearchQuery
}

func (*ExternalIDPSearchRequest) AppendUserQuery

func (r *ExternalIDPSearchRequest) AppendUserQuery(userID string)

func (*ExternalIDPSearchRequest) EnsureLimit

func (r *ExternalIDPSearchRequest) EnsureLimit(limit uint64) error

type ExternalIDPSearchResponse

type ExternalIDPSearchResponse struct {
	Offset      uint64
	Limit       uint64
	TotalResult uint64
	Result      []*ExternalIDPView
	Sequence    uint64
	Timestamp   time.Time
}

type ExternalIDPView

type ExternalIDPView struct {
	UserID          string
	IDPConfigID     string
	ExternalUserID  string
	IDPName         string
	UserDisplayName string
	CreationDate    time.Time
	ChangeDate      time.Time
	ResourceOwner   string
	Sequence        uint64
}

type Gender

type Gender int32
const (
	GenderUnspecified Gender = iota
	GenderFemale
	GenderMale
	GenderDiverse
)

type HumanView

type HumanView struct {
	PasswordSet              bool
	PasswordInitRequired     bool
	PasswordChangeRequired   bool
	UsernameChangeRequired   bool
	PasswordChanged          time.Time
	FirstName                string
	LastName                 string
	NickName                 string
	DisplayName              string
	AvatarKey                string
	AvatarURL                string
	PreSignedAvatar          *url.URL
	PreferredLanguage        string
	Gender                   Gender
	Email                    string
	IsEmailVerified          bool
	Phone                    string
	IsPhoneVerified          bool
	Country                  string
	Locality                 string
	PostalCode               string
	Region                   string
	StreetAddress            string
	OTPState                 MFAState
	U2FTokens                []*WebAuthNView
	PasswordlessTokens       []*WebAuthNView
	MFAMaxSetUp              req_model.MFALevel
	MFAInitSkipped           time.Time
	InitRequired             bool
	PasswordlessInitRequired bool
}

type MFAState

type MFAState int32
const (
	MFAStateUnspecified MFAState = iota
	MFAStateNotReady
	MFAStateReady
)

type MFAType

type MFAType int32
const (
	MFATypeUnspecified MFAType = iota
	MFATypeOTP
	MFATypeU2F
)

type MachineView

type MachineView struct {
	LastKeyAdded time.Time
	Name         string
	Description  string
}

type MemberType

type MemberType int32
const (
	MemberTypeUnspecified MemberType = iota
	MemberTypeOrganisation
	MemberTypeProject
	MemberTypeProjectGrant
	MemberTypeIam
)

type MultiFactor

type MultiFactor struct {
	Type      MFAType
	State     MFAState
	Attribute string
	ID        string
}

type NotificationType

type NotificationType int32
const (
	NotificationTypeEmail NotificationType = iota
	NotificationTypeSms
)

type NotifyUser

type NotifyUser struct {
	ID                 string
	CreationDate       time.Time
	ChangeDate         time.Time
	ResourceOwner      string
	UserName           string
	PreferredLoginName string
	LoginNames         []string
	FirstName          string
	LastName           string
	NickName           string
	DisplayName        string
	PreferredLanguage  string
	Gender             Gender
	LastEmail          string
	VerifiedEmail      string
	LastPhone          string
	VerifiedPhone      string
	PasswordSet        bool
	Sequence           uint64
}

type NotifyUserSearchKey

type NotifyUserSearchKey int32
const (
	NotifyUserSearchKeyUnspecified NotifyUserSearchKey = iota
	NotifyUserSearchKeyUserID
	NotifyUserSearchKeyResourceOwner
)

type NotifyUserSearchQuery

type NotifyUserSearchQuery struct {
	Key    NotifyUserSearchKey
	Method domain.SearchMethod
	Value  string
}

type NotifyUserSearchRequest

type NotifyUserSearchRequest struct {
	Offset        uint64
	Limit         uint64
	SortingColumn NotifyUserSearchKey
	Asc           bool
	Queries       []*NotifyUserSearchQuery
}

type NotifyUserSearchResponse

type NotifyUserSearchResponse struct {
	Offset      uint64
	Limit       uint64
	TotalResult uint64
	Result      []*UserView
}

type Password

type Password struct {
	es_models.ObjectRoot

	SecretString   string
	SecretCrypto   *crypto.CryptoValue
	ChangeRequired bool
}

func (*Password) IsValid

func (p *Password) IsValid() bool

type PasswordCode

type PasswordCode struct {
	es_models.ObjectRoot

	Code             *crypto.CryptoValue
	Expiry           time.Duration
	NotificationType NotificationType
}

type Phone

type Phone struct {
	es_models.ObjectRoot

	PhoneNumber     string
	IsPhoneVerified bool
}

func (*Phone) GeneratePhoneCodeIfNeeded

func (p *Phone) GeneratePhoneCodeIfNeeded(phoneGenerator crypto.Generator) (*PhoneCode, error)

func (*Phone) IsValid

func (p *Phone) IsValid() bool

type PhoneCode

type PhoneCode struct {
	es_models.ObjectRoot

	Code   *crypto.CryptoValue
	Expiry time.Duration
}

func (*PhoneCode) GeneratePhoneCode

func (code *PhoneCode) GeneratePhoneCode(phoneGenerator crypto.Generator) error

type Profile

type Profile struct {
	es_models.ObjectRoot

	FirstName          string
	LastName           string
	NickName           string
	DisplayName        string
	PreferredLanguage  language.Tag
	Gender             Gender
	PreferredLoginName string
	LoginNames         []string
	AvatarURL          string
}

func (*Profile) IsValid

func (p *Profile) IsValid() bool

func (*Profile) SetNamesAsDisplayname

func (p *Profile) SetNamesAsDisplayname()

type RefreshToken

type RefreshToken struct {
	es_models.ObjectRoot

	TokenID           string
	ApplicationID     string
	UserAgentID       string
	Audience          []string
	Expiration        time.Time
	Scopes            []string
	PreferredLanguage string
}

type RefreshTokenSearchKey

type RefreshTokenSearchKey int32
const (
	RefreshTokenSearchKeyUnspecified RefreshTokenSearchKey = iota
	RefreshTokenSearchKeyRefreshTokenID
	RefreshTokenSearchKeyUserID
	RefreshTokenSearchKeyApplicationID
	RefreshTokenSearchKeyUserAgentID
	RefreshTokenSearchKeyExpiration
	RefreshTokenSearchKeyResourceOwner
)

type RefreshTokenSearchQuery

type RefreshTokenSearchQuery struct {
	Key    RefreshTokenSearchKey
	Method domain.SearchMethod
	Value  interface{}
}

type RefreshTokenSearchRequest

type RefreshTokenSearchRequest struct {
	Offset        uint64
	Limit         uint64
	SortingColumn RefreshTokenSearchKey
	Asc           bool
	Queries       []*RefreshTokenSearchQuery
}

func (*RefreshTokenSearchRequest) EnsureLimit

func (r *RefreshTokenSearchRequest) EnsureLimit(limit uint64) error

type RefreshTokenSearchResponse

type RefreshTokenSearchResponse struct {
	Offset      uint64
	Limit       uint64
	TotalResult uint64
	Sequence    uint64
	Timestamp   time.Time
	Result      []*RefreshTokenView
}

type RefreshTokenView

type RefreshTokenView struct {
	ID                    string
	CreationDate          time.Time
	ChangeDate            time.Time
	ResourceOwner         string
	UserID                string
	ClientID              string
	UserAgentID           string
	AuthMethodsReferences []string
	Audience              []string
	AuthTime              time.Time
	IdleExpiration        time.Time
	Expiration            time.Time
	Scopes                []string
	Sequence              uint64
	Token                 string
}

type Token

type Token struct {
	es_models.ObjectRoot

	TokenID           string
	ApplicationID     string
	UserAgentID       string
	Audience          []string
	Expiration        time.Time
	Scopes            []string
	PreferredLanguage string
}

type TokenSearchKey

type TokenSearchKey int32
const (
	TokenSearchKeyUnspecified TokenSearchKey = iota
	TokenSearchKeyTokenID
	TokenSearchKeyUserID
	TokenSearchKeyRefreshTokenID
	TokenSearchKeyApplicationID
	TokenSearchKeyUserAgentID
	TokenSearchKeyExpiration
	TokenSearchKeyResourceOwner
)

type TokenSearchQuery

type TokenSearchQuery struct {
	Key    TokenSearchKey
	Method domain.SearchMethod
	Value  interface{}
}

type TokenSearchRequest

type TokenSearchRequest struct {
	Offset        uint64
	Limit         uint64
	SortingColumn TokenSearchKey
	Asc           bool
	Queries       []*TokenSearchQuery
}

func (*TokenSearchRequest) EnsureLimit

func (r *TokenSearchRequest) EnsureLimit(limit uint64) error

type TokenSearchResponse

type TokenSearchResponse struct {
	Offset      uint64
	Limit       uint64
	TotalResult uint64
	Result      []*Token
}

type TokenView

type TokenView struct {
	ID                string
	CreationDate      time.Time
	ChangeDate        time.Time
	ResourceOwner     string
	UserID            string
	ApplicationID     string
	UserAgentID       string
	Audience          []string
	Expiration        time.Time
	Scopes            []string
	Sequence          uint64
	PreferredLanguage string
	RefreshTokenID    string
	IsPAT             bool
}

type UserChange

type UserChange struct {
	ChangeDate        *timestamp.Timestamp `json:"changeDate,omitempty"`
	EventType         string               `json:"eventType,omitempty"`
	Sequence          uint64               `json:"sequence,omitempty"`
	ModifierID        string               `json:"modifierUser,omitempty"`
	ModifierName      string               `json:"-"`
	ModifierLoginName string               `json:"-"`
	ModifierAvatarURL string               `json:"-"`
	Data              interface{}          `json:"data,omitempty"`
}

type UserChanges

type UserChanges struct {
	Changes      []*UserChange
	LastSequence uint64
}

type UserMembershipSearchKey

type UserMembershipSearchKey int32
const (
	UserMembershipSearchKeyUnspecified UserMembershipSearchKey = iota
	UserMembershipSearchKeyUserID
	UserMembershipSearchKeyMemberType
	UserMembershipSearchKeyAggregateID
	UserMembershipSearchKeyObjectID
	UserMembershipSearchKeyResourceOwner
)

type UserMembershipSearchQuery

type UserMembershipSearchQuery struct {
	Key    UserMembershipSearchKey
	Method domain.SearchMethod
	Value  interface{}
}

type UserMembershipSearchRequest

type UserMembershipSearchRequest struct {
	Offset        uint64
	Limit         uint64
	SortingColumn UserMembershipSearchKey
	Asc           bool
	Queries       []*UserMembershipSearchQuery
}

func (*UserMembershipSearchRequest) AppendResourceOwnerAndIamQuery

func (r *UserMembershipSearchRequest) AppendResourceOwnerAndIamQuery(orgID, iamID string)

func (*UserMembershipSearchRequest) AppendUserIDQuery

func (r *UserMembershipSearchRequest) AppendUserIDQuery(userID string)

func (*UserMembershipSearchRequest) EnsureLimit

func (r *UserMembershipSearchRequest) EnsureLimit(limit uint64) error

func (*UserMembershipSearchRequest) GetSearchQuery

type UserMembershipSearchResponse

type UserMembershipSearchResponse struct {
	Offset      uint64
	Limit       uint64
	TotalResult uint64
	Result      []*UserMembershipView
	Sequence    uint64
	Timestamp   time.Time
}

type UserMembershipView

type UserMembershipView struct {
	UserID      string
	MemberType  MemberType
	AggregateID string
	//ObjectID differs from aggregate id if obejct is sub of an aggregate
	ObjectID string

	Roles             []string
	DisplayName       string
	CreationDate      time.Time
	ChangeDate        time.Time
	ResourceOwner     string
	ResourceOwnerName string
	Sequence          uint64
}

type UserSearchKey

type UserSearchKey int32
const (
	UserSearchKeyUnspecified UserSearchKey = iota
	UserSearchKeyUserID
	UserSearchKeyUserName
	UserSearchKeyFirstName
	UserSearchKeyLastName
	UserSearchKeyNickName
	UserSearchKeyDisplayName
	UserSearchKeyEmail
	UserSearchKeyState
	UserSearchKeyResourceOwner
	UserSearchKeyLoginNames
	UserSearchKeyType
	UserSearchKeyPreferredLoginName
)

type UserSearchQuery

type UserSearchQuery struct {
	Key    UserSearchKey
	Method domain.SearchMethod
	Value  interface{}
}

type UserSearchRequest

type UserSearchRequest struct {
	Offset        uint64
	Limit         uint64
	SortingColumn UserSearchKey
	Asc           bool
	Queries       []*UserSearchQuery
}

func (*UserSearchRequest) AppendMyOrgQuery

func (r *UserSearchRequest) AppendMyOrgQuery(orgID string)

func (*UserSearchRequest) EnsureLimit

func (r *UserSearchRequest) EnsureLimit(limit uint64) error

type UserSearchResponse

type UserSearchResponse struct {
	Offset      uint64
	Limit       uint64
	TotalResult uint64
	Result      []*UserView
	Sequence    uint64
	Timestamp   time.Time
}

type UserSessionSearchKey

type UserSessionSearchKey int32
const (
	UserSessionSearchKeyUnspecified UserSessionSearchKey = iota
	UserSessionSearchKeyUserAgentID
	UserSessionSearchKeyUserID
	UserSessionSearchKeyState
	UserSessionSearchKeyResourceOwner
)

type UserSessionSearchQuery

type UserSessionSearchQuery struct {
	Key    UserSessionSearchKey
	Method domain.SearchMethod
	Value  interface{}
}

type UserSessionSearchRequest

type UserSessionSearchRequest struct {
	Offset        uint64
	Limit         uint64
	SortingColumn UserSessionSearchKey
	Asc           bool
	Queries       []*UserSessionSearchQuery
}

func (*UserSessionSearchRequest) EnsureLimit

func (r *UserSessionSearchRequest) EnsureLimit(limit uint64) error

type UserSessionSearchResponse

type UserSessionSearchResponse struct {
	Offset      uint64
	Limit       uint64
	TotalResult uint64
	Result      []*UserSessionView
}

type UserSessionView

type UserSessionView struct {
	CreationDate                 time.Time
	ChangeDate                   time.Time
	State                        req_model.UserSessionState
	ResourceOwner                string
	UserAgentID                  string
	UserID                       string
	UserName                     string
	LoginName                    string
	DisplayName                  string
	AvatarKey                    string
	AvatarURL                    string
	SelectedIDPConfigID          string
	PasswordVerification         time.Time
	PasswordlessVerification     time.Time
	ExternalLoginVerification    time.Time
	SecondFactorVerification     time.Time
	SecondFactorVerificationType req_model.MFAType
	MultiFactorVerification      time.Time
	MultiFactorVerificationType  req_model.MFAType
	Sequence                     uint64
}

type UserState

type UserState int32
const (
	UserStateUnspecified UserState = iota
	UserStateActive
	UserStateInactive
	UserStateDeleted
	UserStateLocked
	UserStateSuspend
	UserStateInitial
)

type UserView

type UserView struct {
	ID                 string
	UserName           string
	CreationDate       time.Time
	ChangeDate         time.Time
	State              UserState
	Sequence           uint64
	ResourceOwner      string
	LastLogin          time.Time
	PreferredLoginName string
	LoginNames         []string
	*MachineView
	*HumanView
}

func (*UserView) FillUserAvatar

func (u *UserView) FillUserAvatar(ctx context.Context, static static.Storage, expiration time.Duration) error

func (*UserView) GetAddress

func (u *UserView) GetAddress() (*Address, error)

func (*UserView) GetEmail

func (u *UserView) GetEmail() (*Email, error)

func (*UserView) GetPhone

func (u *UserView) GetPhone() (*Phone, error)

func (*UserView) GetProfile

func (u *UserView) GetProfile() (*Profile, error)

func (*UserView) HasRequiredOrgMFALevel

func (u *UserView) HasRequiredOrgMFALevel(policy *iam_model.LoginPolicyView) bool

func (*UserView) IsPasswordlessReady

func (u *UserView) IsPasswordlessReady() bool

func (*UserView) IsU2FReady

func (u *UserView) IsU2FReady() bool

func (*UserView) MFATypesAllowed

func (u *UserView) MFATypesAllowed(level domain.MFALevel, policy *domain.LoginPolicy) ([]domain.MFAType, bool)

func (*UserView) MFATypesSetupPossible

func (u *UserView) MFATypesSetupPossible(level domain.MFALevel, policy *domain.LoginPolicy) []domain.MFAType

type WebAuthNView

type WebAuthNView struct {
	TokenID string
	Name    string
	State   MFAState
}

Jump to

Keyboard shortcuts

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