Documentation
¶
Overview ¶
Package models defines GORM structs that mirror the SQL schema. Migrations remain the source of truth; these structs intentionally carry no index tags.
Index ¶
- type AuditEntry
- type BootstrapToken
- type EmailOutbox
- type EmailProviderConfig
- type EmailVerificationToken
- type GDPRDeletion
- type InstanceAdmin
- type InstanceAdminBackupCode
- type InstanceAdminSession
- type MagicLinkToken
- type MasterKeyRotation
- type OIDCAuthorizationCode
- type OIDCClient
- type OIDCConnection
- type OIDCConsent
- type OIDCRefreshToken
- type OIDCSigningKey
- type PasskeyCredential
- type PasswordCredential
- type PasswordResetToken
- type PendingInvitation
- type Project
- type RateLimitBucket
- type Session
- type SocialConnection
- type StorageObject
- type TOTPCredential
- type Tenant
- type TenantAuthMethod
- type TenantMembership
- type UpstreamProvider
- type User
- type UserBackupCode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuditEntry ¶
type AuditEntry struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey"`
OccurredAt time.Time
TenantID *uuid.UUID `gorm:"type:uuid"`
ActorKind string `gorm:"type:audit_actor_kind"`
ActorID *uuid.UUID `gorm:"type:uuid"`
Action string `gorm:"type:text"`
ResourceKind string `gorm:"type:text"`
ResourceID *uuid.UUID `gorm:"type:uuid"`
StateBefore datatypes.JSON `gorm:"type:jsonb"`
StateAfter datatypes.JSON `gorm:"type:jsonb"`
IP *string `gorm:"type:inet;column:ip"`
UserAgent *string `gorm:"type:text"`
Metadata datatypes.JSON `gorm:"type:jsonb"`
RedactedAt *time.Time
}
type BootstrapToken ¶
type EmailOutbox ¶
type EmailOutbox struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey"`
TenantID *uuid.UUID `gorm:"type:uuid"`
ToAddress string `gorm:"type:citext"`
Template string `gorm:"type:text"`
Payload datatypes.JSON `gorm:"type:jsonb"`
Attempts int
NextAttemptAt time.Time
SentAt *time.Time
FailedAt *time.Time
LastError *string `gorm:"type:text"`
}
func (EmailOutbox) TableName ¶
func (EmailOutbox) TableName() string
type EmailProviderConfig ¶
type EmailVerificationToken ¶
type GDPRDeletion ¶
type InstanceAdmin ¶
type InstanceAdminBackupCode ¶
type InstanceAdminSession ¶
type MagicLinkToken ¶
type MasterKeyRotation ¶
type OIDCAuthorizationCode ¶
type OIDCAuthorizationCode struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey"`
CodeHash []byte
TenantID uuid.UUID `gorm:"type:uuid"`
OIDCClientUUID uuid.UUID `gorm:"type:uuid;column:oidc_client_uuid"`
UserID uuid.UUID `gorm:"type:uuid"`
RedirectURI string `gorm:"type:text"`
Scope pq.StringArray `gorm:"type:text[]"`
PKCEChallenge string `gorm:"type:text;column:pkce_challenge"`
PKCEMethod string `gorm:"type:pkce_method;column:pkce_method"`
Nonce *string `gorm:"type:text"`
ExpiresAt time.Time
ConsumedAt *time.Time
}
func (OIDCAuthorizationCode) TableName ¶
func (OIDCAuthorizationCode) TableName() string
type OIDCClient ¶
type OIDCClient struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey"`
TenantID uuid.UUID `gorm:"type:uuid"`
ProjectID uuid.UUID `gorm:"type:uuid"`
ClientID string `gorm:"type:text"`
ClientSecretEncrypted []byte
RedirectURIs pq.StringArray `gorm:"type:text[]"`
AllowedScopes pq.StringArray `gorm:"type:text[]"`
TokenEndpointAuthMethod string `gorm:"type:oidc_auth_method"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt *time.Time
}
func (OIDCClient) TableName ¶
func (OIDCClient) TableName() string
type OIDCConnection ¶
type OIDCConnection struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey"`
TenantID uuid.UUID `gorm:"type:uuid"`
Slug string
DisplayName string
IssuerURL string
ClientIDEncrypted []byte
ClientSecretEncrypted []byte
Scopes []string `gorm:"type:text[]"`
Config []byte `gorm:"type:jsonb"`
Enabled bool
CreatedAt time.Time
UpdatedAt time.Time
}
func (OIDCConnection) TableName ¶
func (OIDCConnection) TableName() string
type OIDCConsent ¶
type OIDCConsent struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey"`
TenantID uuid.UUID `gorm:"type:uuid"`
UserID uuid.UUID `gorm:"type:uuid"`
OIDCClientUUID uuid.UUID `gorm:"type:uuid;column:oidc_client_uuid"`
Scopes pq.StringArray `gorm:"type:text[]"`
GrantedAt time.Time
RevokedAt *time.Time
}
func (OIDCConsent) TableName ¶
func (OIDCConsent) TableName() string
type OIDCRefreshToken ¶
type OIDCRefreshToken struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey"`
FamilyID uuid.UUID `gorm:"type:uuid"`
ParentID *uuid.UUID `gorm:"type:uuid"`
TokenHash []byte
TenantID uuid.UUID `gorm:"type:uuid"`
OIDCClientUUID uuid.UUID `gorm:"type:uuid;column:oidc_client_uuid"`
UserID uuid.UUID `gorm:"type:uuid"`
Scope pq.StringArray `gorm:"type:text[]"`
ExpiresAt time.Time
ConsumedAt *time.Time
RevokedAt *time.Time
RevokeReason *string `gorm:"type:text"`
}
func (OIDCRefreshToken) TableName ¶
func (OIDCRefreshToken) TableName() string
type OIDCSigningKey ¶
type OIDCSigningKey struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey"`
TenantID uuid.UUID `gorm:"type:uuid"`
KID string `gorm:"type:text;column:kid"`
Algorithm string `gorm:"type:text"`
PublicKeyJWK datatypes.JSON `gorm:"type:jsonb;column:public_key_jwk"`
PrivateKeyEncrypted []byte
State string `gorm:"type:signing_key_state"`
ActivatedAt time.Time
RetiresAt time.Time
SunsetUntil *time.Time
}
func (OIDCSigningKey) TableName ¶
func (OIDCSigningKey) TableName() string
type PasskeyCredential ¶
type PasskeyCredential struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey"`
TenantID uuid.UUID `gorm:"type:uuid"`
UserID uuid.UUID `gorm:"type:uuid"`
CredentialID []byte
PublicKey []byte
SignCount int64
Transports pq.StringArray `gorm:"type:text[]"`
AAGUID *uuid.UUID `gorm:"type:uuid;column:aaguid"`
RPID string `gorm:"type:text;column:rp_id"`
Nickname string `gorm:"type:text"`
CreatedAt time.Time
LastUsedAt *time.Time
}
type PasswordCredential ¶
type PasswordResetToken ¶
type PendingInvitation ¶
type PendingInvitation struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey"`
TenantID *uuid.UUID `gorm:"type:uuid"`
Email string `gorm:"type:citext"`
Role string `gorm:"type:invite_role"`
TokenHash []byte
CreatedByKind string `gorm:"type:invitation_creator_kind"`
CreatedByID *uuid.UUID `gorm:"type:uuid"`
ExpiresAt time.Time
RedeemedAt *time.Time
RedeemedByUserID *uuid.UUID `gorm:"type:uuid"`
CreatedAt time.Time
}
type RateLimitBucket ¶
type Session ¶
type Session struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey"`
SubjectID uuid.UUID `gorm:"type:uuid"`
SubjectKind string `gorm:"type:session_subject_kind"`
TenantID uuid.UUID `gorm:"type:uuid"`
CreatedAt time.Time
LastSeenAt time.Time
ExpiresAt time.Time
RevokedAt *time.Time
IP *string `gorm:"type:inet;column:ip"`
UserAgent *string `gorm:"type:text"`
}
type SocialConnection ¶
type SocialConnection struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey"`
TenantID uuid.UUID `gorm:"type:uuid"`
Kind string `gorm:"type:social_provider_kind"`
ClientIDEncrypted []byte
ClientSecretEncrypted []byte
Enabled bool
Config []byte `gorm:"type:jsonb"`
CreatedAt time.Time
UpdatedAt time.Time
}
func (SocialConnection) TableName ¶
func (SocialConnection) TableName() string
type StorageObject ¶
type StorageObject struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey"`
TenantID uuid.UUID `gorm:"type:uuid"`
Backend string `gorm:"type:storage_backend"`
Key string `gorm:"type:text"`
ContentType string `gorm:"type:text"`
ByteSize int64
OwnerUserID *uuid.UUID `gorm:"type:uuid"`
CreatedAt time.Time
DeletedAt *time.Time
}
type TOTPCredential ¶
type TOTPCredential struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey"`
TenantID uuid.UUID `gorm:"type:uuid"`
UserID uuid.UUID `gorm:"type:uuid"`
SecretEncrypted []byte
Algorithm string `gorm:"type:text"`
Digits int
PeriodSeconds int
ConfirmedAt *time.Time
}
func (TOTPCredential) TableName ¶
func (TOTPCredential) TableName() string
type TenantAuthMethod ¶
type TenantMembership ¶
type UpstreamProvider ¶
type UpstreamProvider struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey"`
TenantID uuid.UUID `gorm:"type:uuid"`
Kind string `gorm:"type:upstream_provider_kind"`
ClientIDEncrypted []byte
ClientSecretEncrypted []byte
Enabled bool
CreatedAt time.Time
}
func (UpstreamProvider) TableName ¶
func (UpstreamProvider) TableName() string
type User ¶
type User struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey"`
TenantID uuid.UUID `gorm:"type:uuid"`
Email string `gorm:"type:citext"`
EmailVerifiedAt *time.Time
Metadata datatypes.JSON `gorm:"type:jsonb"`
ProfilePictureObjectID *uuid.UUID `gorm:"type:uuid"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt *time.Time
}
Click to show internal directories.
Click to hide internal directories.