admin

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateEmail

type CreateEmail struct {
	Address    string `json:"address" validate:"required,email"`
	IsPrimary  bool   `json:"is_primary"`
	IsVerified bool   `json:"is_verified"`
}

type CreateEmailRequestDto

type CreateEmailRequestDto struct {
	ListEmailRequestDto
	CreateEmail
}

type CreateOrUpdatePasswordCredentialRequestDto

type CreateOrUpdatePasswordCredentialRequestDto struct {
	GetPasswordCredentialRequestDto
	Password string `json:"password" validate:"required"`
}

type CreateSessionTokenDto

type CreateSessionTokenDto struct {
	UserID    string `json:"user_id" validate:"required,uuid"`
	UserAgent string `json:"user_agent"`
	IpAddress string `json:"ip_address" validate:"omitempty,ip"`
}

type CreateSessionTokenResponse

type CreateSessionTokenResponse struct {
	SessionToken string `json:"session_token"`
}

type CreateUser

type CreateUser struct {
	ID        uuid.UUID     `json:"id"`
	Emails    []CreateEmail `json:"emails" validate:"unique=Address,dive"`
	Username  *string       `json:"username"`
	CreatedAt time.Time     `json:"created_at"`
}

type CreateWebhookRequestDto

type CreateWebhookRequestDto struct {
	Callback string        `json:"callback" validate:"required,url"`
	Events   events.Events `json:"events" validate:"required,min=1,dive,hanko_event"`
}

type DeleteSessionRequestDto

type DeleteSessionRequestDto struct {
	ListSessionsRequestDto
	SessionID string `param:"session_id" validate:"required,uuid4"`
}

type Email

type Email struct {
	ID         uuid.UUID `json:"id"`
	Address    string    `json:"address"`
	IsVerified bool      `json:"is_verified"`
	IsPrimary  bool      `json:"is_primary"`
	CreatedAt  time.Time `json:"created_at"`
	UpdatedAt  time.Time `json:"updated_at"`
}

func FromEmailModel

func FromEmailModel(email *models.Email) *Email

FromEmailModel Converts the DB model to a DTO object

type GetEmailRequestDto

type GetEmailRequestDto struct {
	ListEmailRequestDto
	EmailId string `param:"email_id" validate:"required,uuid4"`
}

type GetOTPRequestDto

type GetOTPRequestDto struct {
	UserID string `param:"user_id" validate:"required,uuid"`
}

type GetPasswordCredentialRequestDto

type GetPasswordCredentialRequestDto struct {
	UserID string `param:"user_id" validate:"required,uuid"`
}

type GetWebauthnCredentialRequestDto

type GetWebauthnCredentialRequestDto struct {
	ListWebauthnCredentialsRequestDto
	WebauthnCredentialID string `param:"credential_id" validate:"required"`
}

type GetWebhookRequestDto

type GetWebhookRequestDto struct {
	ID string `param:"id" validate:"required,uuid4"`
}

type Identity

type Identity struct {
	ID           uuid.UUID `json:"id"`
	ProviderID   string    `json:"provider_id"`
	ProviderName string    `json:"provider_name"`
	EmailID      uuid.UUID `json:"email_id"`
	CreatedAt    time.Time `json:"created_at"`
	UpdatedAt    time.Time `json:"updated_at"`
}

func FromIdentityModel

func FromIdentityModel(model models.Identity) Identity

type ListEmailRequestDto

type ListEmailRequestDto struct {
	UserId string `param:"user_id" validate:"required,uuid"`
}

type ListSessionsRequestDto

type ListSessionsRequestDto struct {
	UserID string `param:"user_id" validate:"required,uuid"`
}

type ListWebauthnCredentialsRequestDto

type ListWebauthnCredentialsRequestDto struct {
	UserID string `param:"user_id" validate:"required,uuid"`
}

type Metadata

type Metadata struct {
	Public  json.RawMessage `json:"public_metadata,omitempty"`
	Private json.RawMessage `json:"private_metadata,omitempty"`
	Unsafe  json.RawMessage `json:"unsafe_metadata,omitempty"`
}

func NewMetadata

func NewMetadata(metadata *models.UserMetadata) *Metadata

type OTPDto

type OTPDto struct {
	ID        uuid.UUID `json:"id"`
	CreatedAt time.Time `json:"created_at"`
}

type PasswordCredential

type PasswordCredential struct {
	ID        uuid.UUID `json:"id"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type PatchMetadataRequest

type PatchMetadataRequest struct {
	Metadata gjson.Result
}

func (*PatchMetadataRequest) UnmarshalJSON

func (m *PatchMetadataRequest) UnmarshalJSON(data []byte) error

type UpdateWebhookRequestDto

type UpdateWebhookRequestDto struct {
	GetWebhookRequestDto
	CreateWebhookRequestDto
	Enabled bool `json:"enabled" validate:"required,boolean"`
}

type User

type User struct {
	ID                  uuid.UUID                        `json:"id"`
	WebauthnCredentials []dto.WebauthnCredentialResponse `json:"webauthn_credentials,omitempty"`
	Emails              []Email                          `json:"emails,omitempty"`
	Username            *Username                        `json:"username,omitempty"`
	CreatedAt           time.Time                        `json:"created_at"`
	UpdatedAt           time.Time                        `json:"updated_at"`
	Password            *PasswordCredential              `json:"password,omitempty"`
	Identities          []Identity                       `json:"identities,omitempty"`
	OTP                 *OTPDto                          `json:"otp,omitempty"`
	IPAddress           *string                          `json:"ip_address,omitempty"`
	UserAgent           *string                          `json:"user_agent,omitempty"`
	Metadata            *Metadata                        `json:"metadata,omitempty"`
}

func FromUserModel

func FromUserModel(model models.User) User

FromUserModel Converts the DB model to a DTO object

func (*User) SetIPAddress

func (u *User) SetIPAddress(ip string)

func (*User) SetUserAgent

func (u *User) SetUserAgent(agent string)

type Username

type Username struct {
	ID        uuid.UUID `json:"id"`
	Username  string    `json:"username"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

func FromUsernameModel

func FromUsernameModel(model *models.Username) *Username

FromEmailModel Converts the DB model to a DTO object

type WebhookListResponseDto

type WebhookListResponseDto struct {
	Database models.Webhooks `json:"database"`
	Config   config.Webhooks `json:"config"`
}

Jump to

Keyboard shortcuts

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