model

package
v0.0.0-...-860e413 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	UserVersion = "v2"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	es_models.ObjectRoot

	Country       string `json:"country,omitempty"`
	Locality      string `json:"locality,omitempty"`
	PostalCode    string `json:"postalCode,omitempty"`
	Region        string `json:"region,omitempty"`
	StreetAddress string `json:"streetAddress,omitempty"`
}

func (*Address) Changes

func (a *Address) Changes(changed *Address) map[string]interface{}

type AuthRequest

type AuthRequest struct {
	ID                  string `json:"id,omitempty"`
	UserAgentID         string `json:"userAgentID,omitempty"`
	SelectedIDPConfigID string `json:"selectedIDPConfigID,omitempty"`
	*BrowserInfo
}

func (*AuthRequest) SetData

func (a *AuthRequest) SetData(event *es_models.Event) error

type BrowserInfo

type BrowserInfo struct {
	UserAgent      string `json:"userAgent,omitempty"`
	AcceptLanguage string `json:"acceptLanguage,omitempty"`
	RemoteIP       net.IP `json:"remoteIP,omitempty"`
}

type Email

type Email struct {
	es_models.ObjectRoot

	EmailAddress    string `json:"email,omitempty"`
	IsEmailVerified bool   `json:"-"`
}

func (*Email) Changes

func (e *Email) Changes(changed *Email) map[string]interface{}

type EmailCode

type EmailCode struct {
	es_models.ObjectRoot

	Code   *crypto.CryptoValue `json:"code,omitempty"`
	Expiry time.Duration       `json:"expiry,omitempty"`
}

func (*EmailCode) SetData

func (a *EmailCode) SetData(event *es_models.Event) error

type ExternalIDP

type ExternalIDP struct {
	es_models.ObjectRoot

	IDPConfigID string `json:"idpConfigId,omitempty"`
	UserID      string `json:"userId,omitempty"`
	DisplayName string `json:"displayName,omitempty"`
}

func GetExternalIDP

func GetExternalIDP(idps []*ExternalIDP, id string) (int, *ExternalIDP)

type Human

type Human struct {
	*Password
	*Profile
	*Email
	*Phone
	*Address
	ExternalIDPs       []*ExternalIDP   `json:"-"`
	InitCode           *InitUserCode    `json:"-"`
	EmailCode          *EmailCode       `json:"-"`
	PhoneCode          *PhoneCode       `json:"-"`
	PasswordCode       *PasswordCode    `json:"-"`
	OTP                *OTP             `json:"-"`
	U2FTokens          []*WebAuthNToken `json:"-"`
	PasswordlessTokens []*WebAuthNToken `json:"-"`
	U2FLogins          []*WebAuthNLogin `json:"-"`
	PasswordlessLogins []*WebAuthNLogin `json:"-"`
	// contains filtered or unexported fields
}

func (*Human) AppendEvent

func (h *Human) AppendEvent(event *es_models.Event) (err error)

func (*Human) AppendEvents

func (p *Human) AppendEvents(events ...*es_models.Event) error

func (*Human) ComputeObject

func (h *Human) ComputeObject()

type InitUserCode

type InitUserCode struct {
	es_models.ObjectRoot
	Code   *crypto.CryptoValue `json:"code,omitempty"`
	Expiry time.Duration       `json:"expiry,omitempty"`
}

func (*InitUserCode) SetData

func (c *InitUserCode) SetData(event *es_models.Event) error

type LanguageTag

type LanguageTag language.Tag

func (*LanguageTag) MarshalBinary

func (t *LanguageTag) MarshalBinary() ([]byte, error)

func (LanguageTag) MarshalJSON

func (t LanguageTag) MarshalJSON() ([]byte, error)

func (*LanguageTag) UnmarshalBinary

func (t *LanguageTag) UnmarshalBinary(data []byte) error

UnmarshalBinary modifies the receiver so it must take a pointer receiver.

func (*LanguageTag) UnmarshalJSON

func (t *LanguageTag) UnmarshalJSON(data []byte) error

type Machine

type Machine struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	// contains filtered or unexported fields
}

func (*Machine) AppendEvent

func (sa *Machine) AppendEvent(event *es_models.Event) (err error)

func (*Machine) AppendEvents

func (sa *Machine) AppendEvents(events ...*es_models.Event) error

type MachineKey

type MachineKey struct {
	es_models.ObjectRoot `json:"-"`
	KeyID                string    `json:"keyId,omitempty"`
	Type                 int32     `json:"type,omitempty"`
	ExpirationDate       time.Time `json:"expirationDate,omitempty"`
	PublicKey            []byte    `json:"publicKey,omitempty"`
	// contains filtered or unexported fields
}

func (*MachineKey) AppendEvent

func (key *MachineKey) AppendEvent(event *es_models.Event) (err error)

func (*MachineKey) AppendEvents

func (key *MachineKey) AppendEvents(events ...*es_models.Event) error

type OTP

type OTP struct {
	es_models.ObjectRoot

	Secret *crypto.CryptoValue `json:"otpSecret,omitempty"`
	State  int32               `json:"-"`
}

type OTPVerified

type OTPVerified struct {
	UserAgentID string `json:"userAgentID,omitempty"`
}

func (*OTPVerified) SetData

func (o *OTPVerified) SetData(event *es_models.Event) error

type Password

type Password struct {
	es_models.ObjectRoot

	Secret         *crypto.CryptoValue `json:"secret,omitempty"`
	ChangeRequired bool                `json:"changeRequired,omitempty"`
}

type PasswordChange

type PasswordChange struct {
	Password
	UserAgentID string `json:"userAgentID,omitempty"`
}

func (*PasswordChange) SetData

func (pw *PasswordChange) SetData(event *es_models.Event) error

type PasswordCode

type PasswordCode struct {
	es_models.ObjectRoot

	Code             *crypto.CryptoValue `json:"code,omitempty"`
	Expiry           time.Duration       `json:"expiry,omitempty"`
	NotificationType int32               `json:"notificationType,omitempty"`
}

func (*PasswordCode) SetData

func (c *PasswordCode) SetData(event *es_models.Event) error

type Phone

type Phone struct {
	es_models.ObjectRoot

	PhoneNumber     string `json:"phone,omitempty"`
	IsPhoneVerified bool   `json:"-"`
}

func (*Phone) Changes

func (p *Phone) Changes(changed *Phone) map[string]interface{}

type PhoneCode

type PhoneCode struct {
	es_models.ObjectRoot

	Code   *crypto.CryptoValue `json:"code,omitempty"`
	Expiry time.Duration       `json:"expiry,omitempty"`
}

func (*PhoneCode) SetData

func (c *PhoneCode) SetData(event *es_models.Event) error

type Profile

type Profile struct {
	es_models.ObjectRoot

	FirstName         string      `json:"firstName,omitempty"`
	LastName          string      `json:"lastName,omitempty"`
	NickName          string      `json:"nickName,omitempty"`
	DisplayName       string      `json:"displayName,omitempty"`
	PreferredLanguage LanguageTag `json:"preferredLanguage,omitempty"`
	Gender            int32       `json:"gender,omitempty"`
}

func (*Profile) Changes

func (p *Profile) Changes(changed *Profile) map[string]interface{}

type Token

type Token struct {
	es_models.ObjectRoot

	TokenID           string               `json:"tokenId" gorm:"column:token_id"`
	ApplicationID     string               `json:"applicationId" gorm:"column:application_id"`
	UserAgentID       string               `json:"userAgentId" gorm:"column:user_agent_id"`
	Audience          database.StringArray `json:"audience" gorm:"column:audience"`
	Scopes            database.StringArray `json:"scopes" gorm:"column:scopes"`
	Expiration        time.Time            `json:"expiration" gorm:"column:expiration"`
	PreferredLanguage string               `json:"preferredLanguage" gorm:"column:preferred_language"`
}

func (*Token) AppendEvent

func (t *Token) AppendEvent(event *es_models.Event) error

func (*Token) AppendEvents

func (t *Token) AppendEvents(events ...*es_models.Event) error

type User

type User struct {
	es_models.ObjectRoot
	State    int32  `json:"-"`
	UserName string `json:"userName"`

	*Human
	*Machine
}

func (*User) AppendEvent

func (u *User) AppendEvent(event *es_models.Event) error

func (*User) AppendEvents

func (u *User) AppendEvents(events ...*es_models.Event) error

type WebAuthNLogin

type WebAuthNLogin struct {
	es_models.ObjectRoot

	WebauthNTokenID string `json:"webAuthNTokenId"`
	Challenge       string `json:"challenge"`
	*AuthRequest
}

type WebAuthNSignCount

type WebAuthNSignCount struct {
	WebauthNTokenID string `json:"webAuthNTokenId"`
	SignCount       uint32 `json:"signCount"`
}

type WebAuthNToken

type WebAuthNToken struct {
	es_models.ObjectRoot

	WebauthNTokenID string `json:"webAuthNTokenId"`
	Challenge       string `json:"challenge"`
	State           int32  `json:"-"`

	KeyID             []byte `json:"keyId"`
	PublicKey         []byte `json:"publicKey"`
	AttestationType   string `json:"attestationType"`
	AAGUID            []byte `json:"aaguid"`
	SignCount         uint32 `json:"signCount"`
	WebAuthNTokenName string `json:"webAuthNTokenName"`
}

func GetWebauthn

func GetWebauthn(webauthnTokens []*WebAuthNToken, id string) (int, *WebAuthNToken)

type WebAuthNTokenID

type WebAuthNTokenID struct {
	WebauthNTokenID string `json:"webAuthNTokenId"`
}

type WebAuthNVerify

type WebAuthNVerify struct {
	WebAuthNTokenID   string `json:"webAuthNTokenId"`
	KeyID             []byte `json:"keyId"`
	PublicKey         []byte `json:"publicKey"`
	AttestationType   string `json:"attestationType"`
	AAGUID            []byte `json:"aaguid"`
	SignCount         uint32 `json:"signCount"`
	WebAuthNTokenName string `json:"webAuthNTokenName"`
	UserAgentID       string `json:"userAgentID,omitempty"`
}

func (*WebAuthNVerify) SetData

func (w *WebAuthNVerify) SetData(event *es_models.Event) error

Jump to

Keyboard shortcuts

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