Built-in roles are seeded with fixed ids and are read-only for every org. Existing non-owner members receive the Viewer role. Refs #6, #7, #8, #9 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
120 lines
2.1 KiB
Go
120 lines
2.1 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.31.1
|
|
|
|
package store
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type ApiToken struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
UserID uuid.UUID
|
|
Name string
|
|
TokenHash []byte
|
|
Prefix string
|
|
Permissions []string
|
|
ExpiresAt *time.Time
|
|
LastUsedAt *time.Time
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
type Invitation struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
Email string
|
|
RoleID uuid.UUID
|
|
TokenHash []byte
|
|
InvitedBy *uuid.UUID
|
|
ExpiresAt time.Time
|
|
AcceptedAt *time.Time
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
type Membership struct {
|
|
OrgID uuid.UUID
|
|
UserID uuid.UUID
|
|
IsOwner bool
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
type Org struct {
|
|
ID uuid.UUID
|
|
Slug string
|
|
Name string
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
RequireTotp bool
|
|
RequireSso bool
|
|
}
|
|
|
|
type RecoveryCode struct {
|
|
UserID uuid.UUID
|
|
CodeHash []byte
|
|
UsedAt *time.Time
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
type Role struct {
|
|
ID uuid.UUID
|
|
OrgID *uuid.UUID
|
|
Key *string
|
|
Name string
|
|
Permissions []string
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type RoleAssignment struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
UserID uuid.UUID
|
|
RoleID uuid.UUID
|
|
ResourceType *string
|
|
ResourceID *uuid.UUID
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
type SsoProvider struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
Name string
|
|
Issuer string
|
|
ClientID string
|
|
ClientSecret []byte
|
|
Scopes []string
|
|
AllowedDomains []string
|
|
AutoProvision bool
|
|
Enabled bool
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
DefaultRoleID *uuid.UUID
|
|
}
|
|
|
|
type User struct {
|
|
ID uuid.UUID
|
|
Email string
|
|
DisplayName string
|
|
PasswordHash *string
|
|
DisabledAt *time.Time
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
TotpSecret []byte
|
|
TotpEnabledAt *time.Time
|
|
Locale *string
|
|
}
|
|
|
|
type UserIdentity struct {
|
|
ProviderID uuid.UUID
|
|
Subject string
|
|
OrgID uuid.UUID
|
|
UserID uuid.UUID
|
|
Email *string
|
|
CreatedAt time.Time
|
|
LastLoginAt time.Time
|
|
}
|