model

package
v3.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientAuthorization

type ClientAuthorization struct {
	gorm.Model
	LoginHash  []byte     `gorm:"uniqueIndex;size:32;not null"` // SHA256(logintoken)
	PollHash   []byte     `gorm:"uniqueIndex;size:32;not null"` // SHA256(polltoken)
	ClientID   string     `gorm:"uniqueIndex;size:36;not null"` // UUIDv4
	UserAgent  string     `gorm:"size:512;not null"`
	ExpiresAt  time.Time  `gorm:"index;not null"`
	ApprovedAt *time.Time // null = PENDING; non-null = APPROVED
	UserID     string     `gorm:"size:64;index"` // populated on approval
	Username   string     `gorm:"size:255"`      // populated on approval
	DeviceName string     `gorm:"size:64"`       // populated on approval
}

ClientAuthorization is the persisted state of one client enrolment through the login flow. gorm.Model gives ID, CreatedAt, UpdatedAt and DeletedAt; DeletedAt drives the soft-delete that marks an authorization consumed, denied or expired.

Jump to

Keyboard shortcuts

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