models

package
v0.0.0-...-9d4acdc Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Jwk

type Jwk struct {
	ID        int       `db:"id"`
	KeyData   string    `db:"key_data"`
	CreatedAt time.Time `db:"created_at"`
}

func (*Jwk) Validate

func (jwk *Jwk) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type Operation

type Operation string
var (
	WebauthnOperationRegistration   Operation = "registration"
	WebauthnOperationAuthentication Operation = "authentication"
)

type Passcode

type Passcode struct {
	ID        uuid.UUID `db:"id"`
	UserId    uuid.UUID `db:"user_id"`
	Ttl       int       `db:"ttl"` // in seconds
	Code      string    `db:"code"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

Passcode is used by pop to map your passcodes database table to your go code.

func (*Passcode) Validate

func (passcode *Passcode) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type PasswordCredential

type PasswordCredential struct {
	ID        uuid.UUID `db:"id"`
	UserId    uuid.UUID `db:"user_id"`
	Password  string    `db:"password"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

func (*PasswordCredential) Validate

func (password *PasswordCredential) Validate(tx *pop.Connection) (*validate.Errors, error)

type User

type User struct {
	ID                  uuid.UUID            `db:"id" json:"id"`
	Email               string               `db:"email" json:"email"`
	Verified            bool                 `db:"verified" json:"verified"`
	WebauthnCredentials []WebauthnCredential `has_many:"webauthn_credentials" json:"webauthn_credentials,omitempty"`
	CreatedAt           time.Time            `db:"created_at" json:"created_at"`
	UpdatedAt           time.Time            `db:"updated_at" json:"updated_at"`
}

User is used by pop to map your users database table to your go code.

func NewUser

func NewUser(email string) User

func (*User) Validate

func (user *User) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type WebauthnCredential

type WebauthnCredential struct {
	ID              string    `db:"id" json:"id"`
	UserId          uuid.UUID `db:"user_id" json:"-"`
	PublicKey       string    `db:"public_key" json:"-"`
	AttestationType string    `db:"attestation_type" json:"-"`
	AAGUID          uuid.UUID `db:"aaguid" json:"-"`
	SignCount       int       `db:"sign_count" json:"-"`
	CreatedAt       time.Time `db:"created_at" json:"-"`
	UpdatedAt       time.Time `db:"updated_at" json:"-"`
}

WebauthnCredential is used by pop to map your webauthn_credentials database table to your go code.

func (*WebauthnCredential) Validate

func (credential *WebauthnCredential) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type WebauthnSessionData

type WebauthnSessionData struct {
	ID                 uuid.UUID                              `db:"id"`
	Challenge          string                                 `db:"challenge"`
	UserId             uuid.UUID                              `db:"user_id"`
	UserVerification   string                                 `db:"user_verification"`
	CreatedAt          time.Time                              `db:"created_at"`
	UpdatedAt          time.Time                              `db:"updated_at"`
	Operation          Operation                              `db:"operation"`
	AllowedCredentials []WebauthnSessionDataAllowedCredential `has_many:"webauthn_session_data_allowed_credentials"`
}

WebauthnSessionData is used by pop to map your webauthn_session_data database table to your go code.

func (*WebauthnSessionData) Validate

func (sd *WebauthnSessionData) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

type WebauthnSessionDataAllowedCredential

type WebauthnSessionDataAllowedCredential struct {
	ID                    uuid.UUID            `db:"id"`
	CredentialId          string               `db:"credential_id"`
	WebauthnSessionDataID uuid.UUID            `db:"webauthn_session_data_id"`
	CreatedAt             time.Time            `db:"created_at"`
	UpdatedAt             time.Time            `db:"updated_at"`
	WebauthnSessionData   *WebauthnSessionData `belongs_to:"webauthn_session_data"`
}

WebauthnSessionDataAllowedCredential is used by pop to map your webauthn_session_data_allowed_credential database table to your go code.

func (*WebauthnSessionDataAllowedCredential) Validate

func (credential *WebauthnSessionDataAllowedCredential) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.

Jump to

Keyboard shortcuts

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