db

package
v0.0.0-...-c3d4352 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditLog

type AuditLog struct {
	ID           pgtype.UUID        `json:"id"`
	UserID       pgtype.UUID        `json:"user_id"`
	Action       string             `json:"action"`
	ResourceType string             `json:"resource_type"`
	ResourceID   pgtype.UUID        `json:"resource_id"`
	Metadata     []byte             `json:"metadata"`
	IpAddress    *netip.Addr        `json:"ip_address"`
	UserAgent    pgtype.Text        `json:"user_agent"`
	Timestamp    pgtype.Timestamptz `json:"timestamp"`
}

type BackupRecoveryCode

type BackupRecoveryCode struct {
	ID                  pgtype.UUID        `json:"id"`
	UserID              pgtype.UUID        `json:"user_id"`
	EncryptedBackupData []byte             `json:"encrypted_backup_data"`
	RecoveryCodeHash    []byte             `json:"recovery_code_hash"`
	IsUsed              pgtype.Bool        `json:"is_used"`
	CreatedAt           pgtype.Timestamptz `json:"created_at"`
	UsedAt              pgtype.Timestamptz `json:"used_at"`
}

type CreateAuditLogParams

type CreateAuditLogParams struct {
	UserID       pgtype.UUID `json:"user_id"`
	Action       string      `json:"action"`
	ResourceType string      `json:"resource_type"`
	ResourceID   pgtype.UUID `json:"resource_id"`
	Metadata     []byte      `json:"metadata"`
	IpAddress    *netip.Addr `json:"ip_address"`
	UserAgent    pgtype.Text `json:"user_agent"`
}

type CreateBackupRecoveryCodeParams

type CreateBackupRecoveryCodeParams struct {
	UserID              pgtype.UUID `json:"user_id"`
	EncryptedBackupData []byte      `json:"encrypted_backup_data"`
	RecoveryCodeHash    []byte      `json:"recovery_code_hash"`
}

type CreateDeviceSessionParams

type CreateDeviceSessionParams struct {
	UserID            pgtype.UUID `json:"user_id"`
	DeviceFingerprint string      `json:"device_fingerprint"`
	DeviceName        pgtype.Text `json:"device_name"`
}

type CreateEncryptedTOTPSeedParams

type CreateEncryptedTOTPSeedParams struct {
	UserID            pgtype.UUID `json:"user_id"`
	ServiceName       string      `json:"service_name"`
	AccountIdentifier string      `json:"account_identifier"`
	EncryptedSecret   []byte      `json:"encrypted_secret"`
	Algorithm         string      `json:"algorithm"`
	Digits            int32       `json:"digits"`
	Period            int32       `json:"period"`
	Issuer            pgtype.Text `json:"issuer"`
	IconUrl           pgtype.Text `json:"icon_url"`
	IsActive          pgtype.Bool `json:"is_active"`
}

type CreateSyncOperationParams

type CreateSyncOperationParams struct {
	UserID            pgtype.UUID `json:"user_id"`
	OperationType     string      `json:"operation_type"`
	EntityType        string      `json:"entity_type"`
	EntityID          pgtype.UUID `json:"entity_id"`
	OperationData     []byte      `json:"operation_data"`
	DeviceFingerprint string      `json:"device_fingerprint"`
}

type CreateUserEncryptionKeyParams

type CreateUserEncryptionKeyParams struct {
	UserID               pgtype.UUID `json:"user_id"`
	WebauthnCredentialID pgtype.UUID `json:"webauthn_credential_id"`
	EncryptedDek         []byte      `json:"encrypted_dek"`
	KeyVersion           int32       `json:"key_version"`
}

type CreateUserParams

type CreateUserParams struct {
	Username    string `json:"username"`
	Email       string `json:"email"`
	DisplayName string `json:"display_name"`
}

type CreateWebAuthnCredentialParams

type CreateWebAuthnCredentialParams struct {
	UserID          pgtype.UUID `json:"user_id"`
	CredentialID    []byte      `json:"credential_id"`
	PublicKey       []byte      `json:"public_key"`
	AttestationType string      `json:"attestation_type"`
	Transport       []string    `json:"transport"`
	Flags           []byte      `json:"flags"`
	Authenticator   []byte      `json:"authenticator"`
	DeviceName      pgtype.Text `json:"device_name"`
	Aaguid          pgtype.UUID `json:"aaguid"`
	CloneWarning    bool        `json:"clone_warning"`
	SignCount       int64       `json:"sign_count"`
	Attachment      pgtype.Text `json:"attachment"`
	BackupEligible  bool        `json:"backup_eligible"`
	BackupState     bool        `json:"backup_state"`
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type DeleteEncryptedTOTPSeedParams

type DeleteEncryptedTOTPSeedParams struct {
	ID     pgtype.UUID `json:"id"`
	UserID pgtype.UUID `json:"user_id"`
}

type DeleteWebAuthnCredentialParams

type DeleteWebAuthnCredentialParams struct {
	CredentialID []byte      `json:"credential_id"`
	UserID       pgtype.UUID `json:"user_id"`
}

type DeviceSession

type DeviceSession struct {
	ID                pgtype.UUID        `json:"id"`
	UserID            pgtype.UUID        `json:"user_id"`
	DeviceFingerprint string             `json:"device_fingerprint"`
	DeviceName        pgtype.Text        `json:"device_name"`
	LastSyncAt        pgtype.Timestamptz `json:"last_sync_at"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
}

type EncryptedTotpSeed

type EncryptedTotpSeed struct {
	ID                pgtype.UUID        `json:"id"`
	UserID            pgtype.UUID        `json:"user_id"`
	ServiceName       string             `json:"service_name"`
	AccountIdentifier string             `json:"account_identifier"`
	EncryptedSecret   []byte             `json:"encrypted_secret"`
	Algorithm         string             `json:"algorithm"`
	Digits            int32              `json:"digits"`
	Period            int32              `json:"period"`
	Issuer            pgtype.Text        `json:"issuer"`
	IconUrl           pgtype.Text        `json:"icon_url"`
	IsActive          pgtype.Bool        `json:"is_active"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
}

type GetAuditLogsByActionParams

type GetAuditLogsByActionParams struct {
	Action      string             `json:"action"`
	Timestamp   pgtype.Timestamptz `json:"timestamp"`
	Timestamp_2 pgtype.Timestamptz `json:"timestamp_2"`
	Limit       int32              `json:"limit"`
	Offset      int32              `json:"offset"`
}

type GetAuditLogsByUserIDParams

type GetAuditLogsByUserIDParams struct {
	UserID pgtype.UUID `json:"user_id"`
	Limit  int32       `json:"limit"`
	Offset int32       `json:"offset"`
}

type GetBackupRecoveryCodeByIDParams

type GetBackupRecoveryCodeByIDParams struct {
	ID     pgtype.UUID `json:"id"`
	UserID pgtype.UUID `json:"user_id"`
}

type GetDeviceSessionParams

type GetDeviceSessionParams struct {
	UserID            pgtype.UUID `json:"user_id"`
	DeviceFingerprint string      `json:"device_fingerprint"`
}

type GetEncryptedTOTPSeedByIDParams

type GetEncryptedTOTPSeedByIDParams struct {
	ID     pgtype.UUID `json:"id"`
	UserID pgtype.UUID `json:"user_id"`
}

type GetEncryptedTOTPSeedsByUserIDSinceParams

type GetEncryptedTOTPSeedsByUserIDSinceParams struct {
	UserID    pgtype.UUID        `json:"user_id"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}

type GetRecentAuditLogsParams

type GetRecentAuditLogsParams struct {
	Timestamp pgtype.Timestamptz `json:"timestamp"`
	Limit     int32              `json:"limit"`
	Offset    int32              `json:"offset"`
}

type GetRecentAuditLogsRow

type GetRecentAuditLogsRow struct {
	ID           pgtype.UUID        `json:"id"`
	UserID       pgtype.UUID        `json:"user_id"`
	Action       string             `json:"action"`
	ResourceType string             `json:"resource_type"`
	ResourceID   pgtype.UUID        `json:"resource_id"`
	Metadata     []byte             `json:"metadata"`
	IpAddress    *netip.Addr        `json:"ip_address"`
	UserAgent    pgtype.Text        `json:"user_agent"`
	Timestamp    pgtype.Timestamptz `json:"timestamp"`
	Username     pgtype.Text        `json:"username"`
	Email        pgtype.Text        `json:"email"`
}

type GetSyncOperationsSinceParams

type GetSyncOperationsSinceParams struct {
	UserID    pgtype.UUID        `json:"user_id"`
	Timestamp pgtype.Timestamptz `json:"timestamp"`
}

type GetSyncOperationsSinceRow

type GetSyncOperationsSinceRow struct {
	ID                pgtype.UUID        `json:"id"`
	UserID            pgtype.UUID        `json:"user_id"`
	OperationType     string             `json:"operation_type"`
	EntityType        string             `json:"entity_type"`
	EntityID          pgtype.UUID        `json:"entity_id"`
	OperationData     []byte             `json:"operation_data"`
	DeviceFingerprint string             `json:"device_fingerprint"`
	Timestamp         pgtype.Timestamptz `json:"timestamp"`
	DeviceName        pgtype.Text        `json:"device_name"`
}

type GetUserEncryptionKeyByCredentialParams

type GetUserEncryptionKeyByCredentialParams struct {
	UserID               pgtype.UUID `json:"user_id"`
	WebauthnCredentialID pgtype.UUID `json:"webauthn_credential_id"`
}

type GetUserEncryptionKeyByVersionParams

type GetUserEncryptionKeyByVersionParams struct {
	UserID     pgtype.UUID `json:"user_id"`
	KeyVersion int32       `json:"key_version"`
}

type LinkingCode

type LinkingCode struct {
	ID        pgtype.UUID        `json:"id"`
	UserID    pgtype.UUID        `json:"user_id"`
	Code      string             `json:"code"`
	IsUsed    bool               `json:"is_used"`
	ExpiresAt time.Time          `json:"expires_at"`
	UsedAt    pgtype.Timestamptz `json:"used_at"`
	CreatedAt time.Time          `json:"created_at"`
	UpdatedAt time.Time          `json:"updated_at"`
}

type ListUsersParams

type ListUsersParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type Querier

type Querier interface {
	CountUsers(ctx context.Context) (int64, error)
	CreateAuditLog(ctx context.Context, arg CreateAuditLogParams) (AuditLog, error)
	CreateBackupRecoveryCode(ctx context.Context, arg CreateBackupRecoveryCodeParams) (BackupRecoveryCode, error)
	CreateDeviceSession(ctx context.Context, arg CreateDeviceSessionParams) (DeviceSession, error)
	CreateEncryptedTOTPSeed(ctx context.Context, arg CreateEncryptedTOTPSeedParams) (EncryptedTotpSeed, error)
	CreateSyncOperation(ctx context.Context, arg CreateSyncOperationParams) (SyncOperation, error)
	CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
	CreateUserEncryptionKey(ctx context.Context, arg CreateUserEncryptionKeyParams) (UserEncryptionKey, error)
	CreateWebAuthnCredential(ctx context.Context, arg CreateWebAuthnCredentialParams) (WebauthnCredential, error)
	DeactivateUser(ctx context.Context, id pgtype.UUID) error
	DeleteEncryptedTOTPSeed(ctx context.Context, arg DeleteEncryptedTOTPSeedParams) error
	DeleteUser(ctx context.Context, id pgtype.UUID) error
	DeleteWebAuthnCredential(ctx context.Context, arg DeleteWebAuthnCredentialParams) error
	GetActiveBackupRecoveryCode(ctx context.Context, userID pgtype.UUID) (BackupRecoveryCode, error)
	GetActiveDeviceSessionsByUserID(ctx context.Context, userID pgtype.UUID) ([]DeviceSession, error)
	GetActiveUserEncryptionKey(ctx context.Context, userID pgtype.UUID) (UserEncryptionKey, error)
	GetAuditLogsByAction(ctx context.Context, arg GetAuditLogsByActionParams) ([]AuditLog, error)
	GetAuditLogsByUserID(ctx context.Context, arg GetAuditLogsByUserIDParams) ([]AuditLog, error)
	GetBackupRecoveryCodeByID(ctx context.Context, arg GetBackupRecoveryCodeByIDParams) (BackupRecoveryCode, error)
	GetDeviceSession(ctx context.Context, arg GetDeviceSessionParams) (DeviceSession, error)
	GetEncryptedTOTPSeedByID(ctx context.Context, arg GetEncryptedTOTPSeedByIDParams) (EncryptedTotpSeed, error)
	GetEncryptedTOTPSeedsByUserID(ctx context.Context, userID pgtype.UUID) ([]EncryptedTotpSeed, error)
	GetEncryptedTOTPSeedsByUserIDSince(ctx context.Context, arg GetEncryptedTOTPSeedsByUserIDSinceParams) ([]EncryptedTotpSeed, error)
	GetLatestSyncTimestamp(ctx context.Context, userID pgtype.UUID) (interface{}, error)
	GetRecentAuditLogs(ctx context.Context, arg GetRecentAuditLogsParams) ([]GetRecentAuditLogsRow, error)
	GetSyncOperationsSince(ctx context.Context, arg GetSyncOperationsSinceParams) ([]GetSyncOperationsSinceRow, error)
	GetTOTPSeedsCountByUser(ctx context.Context, userID pgtype.UUID) (int64, error)
	GetUserByEmail(ctx context.Context, email string) (User, error)
	GetUserByID(ctx context.Context, id pgtype.UUID) (User, error)
	GetUserByUsername(ctx context.Context, username string) (User, error)
	GetUserEncryptionKeyByCredential(ctx context.Context, arg GetUserEncryptionKeyByCredentialParams) (UserEncryptionKey, error)
	GetUserEncryptionKeyByVersion(ctx context.Context, arg GetUserEncryptionKeyByVersionParams) (UserEncryptionKey, error)
	GetUserEncryptionKeys(ctx context.Context, userID pgtype.UUID) ([]UserEncryptionKey, error)
	GetWebAuthnCredentialByID(ctx context.Context, credentialID []byte) (WebauthnCredential, error)
	GetWebAuthnCredentialsByUserID(ctx context.Context, userID pgtype.UUID) ([]WebauthnCredential, error)
	ListUsers(ctx context.Context, arg ListUsersParams) ([]User, error)
	SearchEncryptedTOTPSeeds(ctx context.Context, arg SearchEncryptedTOTPSeedsParams) ([]EncryptedTotpSeed, error)
	UpdateDeviceSessionLastSync(ctx context.Context, arg UpdateDeviceSessionLastSyncParams) error
	UpdateEncryptedTOTPSeed(ctx context.Context, arg UpdateEncryptedTOTPSeedParams) (EncryptedTotpSeed, error)
	UpdateTOTPSeedSyncTimestamp(ctx context.Context, arg UpdateTOTPSeedSyncTimestampParams) error
	UpdateUser(ctx context.Context, arg UpdateUserParams) (User, error)
	UpdateUserLastLogin(ctx context.Context, id pgtype.UUID) error
	UpdateWebAuthnCredentialCloneWarning(ctx context.Context, arg UpdateWebAuthnCredentialCloneWarningParams) error
	UpdateWebAuthnCredentialLastUsed(ctx context.Context, credentialID []byte) error
	UpdateWebAuthnCredentialSignCount(ctx context.Context, arg UpdateWebAuthnCredentialSignCountParams) error
	UseBackupRecoveryCode(ctx context.Context, arg UseBackupRecoveryCodeParams) error
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) CountUsers

func (q *Queries) CountUsers(ctx context.Context) (int64, error)

func (*Queries) CreateAuditLog

func (q *Queries) CreateAuditLog(ctx context.Context, arg CreateAuditLogParams) (AuditLog, error)

func (*Queries) CreateBackupRecoveryCode

func (q *Queries) CreateBackupRecoveryCode(ctx context.Context, arg CreateBackupRecoveryCodeParams) (BackupRecoveryCode, error)

func (*Queries) CreateDeviceSession

func (q *Queries) CreateDeviceSession(ctx context.Context, arg CreateDeviceSessionParams) (DeviceSession, error)

func (*Queries) CreateEncryptedTOTPSeed

func (q *Queries) CreateEncryptedTOTPSeed(ctx context.Context, arg CreateEncryptedTOTPSeedParams) (EncryptedTotpSeed, error)

func (*Queries) CreateSyncOperation

func (q *Queries) CreateSyncOperation(ctx context.Context, arg CreateSyncOperationParams) (SyncOperation, error)

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)

func (*Queries) CreateUserEncryptionKey

func (q *Queries) CreateUserEncryptionKey(ctx context.Context, arg CreateUserEncryptionKeyParams) (UserEncryptionKey, error)

func (*Queries) CreateWebAuthnCredential

func (q *Queries) CreateWebAuthnCredential(ctx context.Context, arg CreateWebAuthnCredentialParams) (WebauthnCredential, error)

func (*Queries) DeactivateUser

func (q *Queries) DeactivateUser(ctx context.Context, id pgtype.UUID) error

func (*Queries) DeleteEncryptedTOTPSeed

func (q *Queries) DeleteEncryptedTOTPSeed(ctx context.Context, arg DeleteEncryptedTOTPSeedParams) error

func (*Queries) DeleteUser

func (q *Queries) DeleteUser(ctx context.Context, id pgtype.UUID) error

func (*Queries) DeleteWebAuthnCredential

func (q *Queries) DeleteWebAuthnCredential(ctx context.Context, arg DeleteWebAuthnCredentialParams) error

func (*Queries) GetActiveBackupRecoveryCode

func (q *Queries) GetActiveBackupRecoveryCode(ctx context.Context, userID pgtype.UUID) (BackupRecoveryCode, error)

func (*Queries) GetActiveDeviceSessionsByUserID

func (q *Queries) GetActiveDeviceSessionsByUserID(ctx context.Context, userID pgtype.UUID) ([]DeviceSession, error)

func (*Queries) GetActiveUserEncryptionKey

func (q *Queries) GetActiveUserEncryptionKey(ctx context.Context, userID pgtype.UUID) (UserEncryptionKey, error)

func (*Queries) GetAuditLogsByAction

func (q *Queries) GetAuditLogsByAction(ctx context.Context, arg GetAuditLogsByActionParams) ([]AuditLog, error)

func (*Queries) GetAuditLogsByUserID

func (q *Queries) GetAuditLogsByUserID(ctx context.Context, arg GetAuditLogsByUserIDParams) ([]AuditLog, error)

func (*Queries) GetBackupRecoveryCodeByID

func (q *Queries) GetBackupRecoveryCodeByID(ctx context.Context, arg GetBackupRecoveryCodeByIDParams) (BackupRecoveryCode, error)

func (*Queries) GetDeviceSession

func (q *Queries) GetDeviceSession(ctx context.Context, arg GetDeviceSessionParams) (DeviceSession, error)

func (*Queries) GetEncryptedTOTPSeedByID

func (q *Queries) GetEncryptedTOTPSeedByID(ctx context.Context, arg GetEncryptedTOTPSeedByIDParams) (EncryptedTotpSeed, error)

func (*Queries) GetEncryptedTOTPSeedsByUserID

func (q *Queries) GetEncryptedTOTPSeedsByUserID(ctx context.Context, userID pgtype.UUID) ([]EncryptedTotpSeed, error)

func (*Queries) GetEncryptedTOTPSeedsByUserIDSince

func (q *Queries) GetEncryptedTOTPSeedsByUserIDSince(ctx context.Context, arg GetEncryptedTOTPSeedsByUserIDSinceParams) ([]EncryptedTotpSeed, error)

func (*Queries) GetLatestSyncTimestamp

func (q *Queries) GetLatestSyncTimestamp(ctx context.Context, userID pgtype.UUID) (interface{}, error)

func (*Queries) GetRecentAuditLogs

func (q *Queries) GetRecentAuditLogs(ctx context.Context, arg GetRecentAuditLogsParams) ([]GetRecentAuditLogsRow, error)

func (*Queries) GetSyncOperationsSince

func (q *Queries) GetSyncOperationsSince(ctx context.Context, arg GetSyncOperationsSinceParams) ([]GetSyncOperationsSinceRow, error)

func (*Queries) GetTOTPSeedsCountByUser

func (q *Queries) GetTOTPSeedsCountByUser(ctx context.Context, userID pgtype.UUID) (int64, error)

func (*Queries) GetUserByEmail

func (q *Queries) GetUserByEmail(ctx context.Context, email string) (User, error)

func (*Queries) GetUserByID

func (q *Queries) GetUserByID(ctx context.Context, id pgtype.UUID) (User, error)

func (*Queries) GetUserByUsername

func (q *Queries) GetUserByUsername(ctx context.Context, username string) (User, error)

func (*Queries) GetUserEncryptionKeyByCredential

func (q *Queries) GetUserEncryptionKeyByCredential(ctx context.Context, arg GetUserEncryptionKeyByCredentialParams) (UserEncryptionKey, error)

func (*Queries) GetUserEncryptionKeyByVersion

func (q *Queries) GetUserEncryptionKeyByVersion(ctx context.Context, arg GetUserEncryptionKeyByVersionParams) (UserEncryptionKey, error)

func (*Queries) GetUserEncryptionKeys

func (q *Queries) GetUserEncryptionKeys(ctx context.Context, userID pgtype.UUID) ([]UserEncryptionKey, error)

func (*Queries) GetWebAuthnCredentialByID

func (q *Queries) GetWebAuthnCredentialByID(ctx context.Context, credentialID []byte) (WebauthnCredential, error)

func (*Queries) GetWebAuthnCredentialsByUserID

func (q *Queries) GetWebAuthnCredentialsByUserID(ctx context.Context, userID pgtype.UUID) ([]WebauthnCredential, error)

func (*Queries) ListUsers

func (q *Queries) ListUsers(ctx context.Context, arg ListUsersParams) ([]User, error)

func (*Queries) SearchEncryptedTOTPSeeds

func (q *Queries) SearchEncryptedTOTPSeeds(ctx context.Context, arg SearchEncryptedTOTPSeedsParams) ([]EncryptedTotpSeed, error)

func (*Queries) UpdateDeviceSessionLastSync

func (q *Queries) UpdateDeviceSessionLastSync(ctx context.Context, arg UpdateDeviceSessionLastSyncParams) error

func (*Queries) UpdateEncryptedTOTPSeed

func (q *Queries) UpdateEncryptedTOTPSeed(ctx context.Context, arg UpdateEncryptedTOTPSeedParams) (EncryptedTotpSeed, error)

func (*Queries) UpdateTOTPSeedSyncTimestamp

func (q *Queries) UpdateTOTPSeedSyncTimestamp(ctx context.Context, arg UpdateTOTPSeedSyncTimestampParams) error

func (*Queries) UpdateUser

func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) (User, error)

func (*Queries) UpdateUserLastLogin

func (q *Queries) UpdateUserLastLogin(ctx context.Context, id pgtype.UUID) error

func (*Queries) UpdateWebAuthnCredentialCloneWarning

func (q *Queries) UpdateWebAuthnCredentialCloneWarning(ctx context.Context, arg UpdateWebAuthnCredentialCloneWarningParams) error

func (*Queries) UpdateWebAuthnCredentialLastUsed

func (q *Queries) UpdateWebAuthnCredentialLastUsed(ctx context.Context, credentialID []byte) error

func (*Queries) UpdateWebAuthnCredentialSignCount

func (q *Queries) UpdateWebAuthnCredentialSignCount(ctx context.Context, arg UpdateWebAuthnCredentialSignCountParams) error

func (*Queries) UseBackupRecoveryCode

func (q *Queries) UseBackupRecoveryCode(ctx context.Context, arg UseBackupRecoveryCodeParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type SearchEncryptedTOTPSeedsParams

type SearchEncryptedTOTPSeedsParams struct {
	UserID  pgtype.UUID `json:"user_id"`
	Column2 pgtype.Text `json:"column_2"`
}

type SyncOperation

type SyncOperation struct {
	ID                pgtype.UUID        `json:"id"`
	UserID            pgtype.UUID        `json:"user_id"`
	OperationType     string             `json:"operation_type"`
	EntityType        string             `json:"entity_type"`
	EntityID          pgtype.UUID        `json:"entity_id"`
	OperationData     []byte             `json:"operation_data"`
	DeviceFingerprint string             `json:"device_fingerprint"`
	Timestamp         pgtype.Timestamptz `json:"timestamp"`
}

type UpdateDeviceSessionLastSyncParams

type UpdateDeviceSessionLastSyncParams struct {
	UserID            pgtype.UUID `json:"user_id"`
	DeviceFingerprint string      `json:"device_fingerprint"`
}

type UpdateEncryptedTOTPSeedParams

type UpdateEncryptedTOTPSeedParams struct {
	ID                pgtype.UUID `json:"id"`
	UserID            pgtype.UUID `json:"user_id"`
	ServiceName       pgtype.Text `json:"service_name"`
	AccountIdentifier pgtype.Text `json:"account_identifier"`
	EncryptedSecret   []byte      `json:"encrypted_secret"`
	Algorithm         pgtype.Text `json:"algorithm"`
	Digits            pgtype.Int4 `json:"digits"`
	Period            pgtype.Int4 `json:"period"`
	Issuer            pgtype.Text `json:"issuer"`
	IconUrl           pgtype.Text `json:"icon_url"`
}

type UpdateTOTPSeedSyncTimestampParams

type UpdateTOTPSeedSyncTimestampParams struct {
	ID     pgtype.UUID `json:"id"`
	UserID pgtype.UUID `json:"user_id"`
}

type UpdateUserParams

type UpdateUserParams struct {
	ID          pgtype.UUID `json:"id"`
	Username    string      `json:"username"`
	Email       string      `json:"email"`
	DisplayName string      `json:"display_name"`
}

type UpdateWebAuthnCredentialCloneWarningParams

type UpdateWebAuthnCredentialCloneWarningParams struct {
	CredentialID []byte `json:"credential_id"`
	CloneWarning bool   `json:"clone_warning"`
}

type UpdateWebAuthnCredentialSignCountParams

type UpdateWebAuthnCredentialSignCountParams struct {
	CredentialID []byte `json:"credential_id"`
	SignCount    int64  `json:"sign_count"`
}

type UseBackupRecoveryCodeParams

type UseBackupRecoveryCodeParams struct {
	ID     pgtype.UUID `json:"id"`
	UserID pgtype.UUID `json:"user_id"`
}

type User

type User struct {
	ID          pgtype.UUID        `json:"id"`
	Username    string             `json:"username"`
	Email       string             `json:"email"`
	DisplayName string             `json:"display_name"`
	CreatedAt   pgtype.Timestamptz `json:"created_at"`
	UpdatedAt   pgtype.Timestamptz `json:"updated_at"`
	LastLoginAt pgtype.Timestamptz `json:"last_login_at"`
	IsActive    pgtype.Bool        `json:"is_active"`
}

type UserEncryptionKey

type UserEncryptionKey struct {
	ID                   pgtype.UUID        `json:"id"`
	UserID               pgtype.UUID        `json:"user_id"`
	WebauthnCredentialID pgtype.UUID        `json:"webauthn_credential_id"`
	EncryptedDek         []byte             `json:"encrypted_dek"`
	KeyVersion           int32              `json:"key_version"`
	CreatedAt            pgtype.Timestamptz `json:"created_at"`
}

type WebauthnCredential

type WebauthnCredential struct {
	ID              pgtype.UUID        `json:"id"`
	UserID          pgtype.UUID        `json:"user_id"`
	CredentialID    []byte             `json:"credential_id"`
	PublicKey       []byte             `json:"public_key"`
	AttestationType string             `json:"attestation_type"`
	Transport       []string           `json:"transport"`
	Flags           []byte             `json:"flags"`
	Authenticator   []byte             `json:"authenticator"`
	DeviceName      pgtype.Text        `json:"device_name"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
	LastUsedAt      pgtype.Timestamptz `json:"last_used_at"`
	Aaguid          pgtype.UUID        `json:"aaguid"`
	CloneWarning    bool               `json:"clone_warning"`
	SignCount       int64              `json:"sign_count"`
	Attachment      pgtype.Text        `json:"attachment"`
	BackupEligible  bool               `json:"backup_eligible"`
	BackupState     bool               `json:"backup_state"`
}

Jump to

Keyboard shortcuts

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