sqlc

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	ID        string
	OrgID     string
	OwnerKind string
	OwnerID   string
	RevokedAt sql.NullTime
}

type Approval

type Approval struct {
	GrantID   string
	ID        string
	HumanID   string
	ExpiresAt time.Time
}

type ApprovalRequest

type ApprovalRequest struct {
	ID         string
	OrgID      string
	AgentID    string
	ItemID     string
	GrantID    string
	Action     string
	Status     string
	CreatedAt  time.Time
	ExpiresAt  time.Time
	ResolvedAt sql.NullTime
	ResolvedBy sql.NullString
	ApprovalID sql.NullString
}

type ApproveOpenRequestParams

type ApproveOpenRequestParams struct {
	At         time.Time
	HumanID    string
	ApprovalID string
	ID         string
}

type ApproveRequestsForGrantParams

type ApproveRequestsForGrantParams struct {
	At         time.Time
	HumanID    string
	ApprovalID string
	GrantID    string
}

type Audit

type Audit struct {
	ID         int64
	At         time.Time
	OrgID      string
	AgentID    string
	ItemID     string
	Action     string
	Decision   string
	Reason     string
	ApprovalID string
}

type AuditOutbox

type AuditOutbox struct {
	ID         int64
	At         time.Time
	OrgID      string
	AgentID    string
	ItemID     string
	Action     string
	Decision   string
	Reason     string
	ApprovalID string
}

type BumpOrgKeyParams

type BumpOrgKeyParams struct {
	Wrapped    []byte
	RotatedAt  time.Time
	OrgID      string
	KeyVersion int32
}

type CancelRequestsForAgentParams

type CancelRequestsForAgentParams struct {
	At      time.Time
	AgentID string
}

type CancelRequestsForItemParams

type CancelRequestsForItemParams struct {
	At     time.Time
	ItemID string
}

type ConsumeRecoveryWrapParams

type ConsumeRecoveryWrapParams struct {
	UsedAt    time.Time
	OrgID     string
	OwnerKind string
	OwnerID   string
}

type ConsumeSessionParams

type ConsumeSessionParams struct {
	SessionHash []byte
	Now         time.Time
}

type ConsumeSessionRow

type ConsumeSessionRow struct {
	AgentID        string
	AgentOrgID     string
	AgentOwnerKind string
	AgentOwnerID   string
	AgentRevokedAt sql.NullTime
}

type ConsumeUseParams

type ConsumeUseParams struct {
	OrgID       string
	WindowStart time.Time
}

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 DeleteGroupMemberParams

type DeleteGroupMemberParams struct {
	GroupID    string
	MemberKind string
	MemberID   string
}

type DeleteWorkloadParams

type DeleteWorkloadParams struct {
	Issuer  string
	Subject string
}

type ExpireOpenRequestParams

type ExpireOpenRequestParams struct {
	Now     time.Time
	GrantID string
	Action  string
}

type GetUsageParams

type GetUsageParams struct {
	OrgID       string
	WindowStart time.Time
}

type GetUsageReportPendingRow

type GetUsageReportPendingRow struct {
	OrgID            string
	WindowStart      time.Time
	Used             int64
	Reported         int64
	CustomerID       string
	BillingAccountID string
}

type Grant

type Grant struct {
	ID          string
	OrgID       string
	AgentID     string
	SubjectKind string
	ItemID      string
	Level       string
	Actions     string
	ExpiresAt   sql.NullTime
}

type GrantForParams

type GrantForParams struct {
	AgentID string
	ItemID  string
}

type Group

type Group struct {
	ID    string
	OrgID string
	Name  string
}

type GroupMember

type GroupMember struct {
	GroupID    string
	MemberKind string
	MemberID   string
}

type Human

type Human struct {
	ID    string
	OrgID string
}

type InsertAuditOutboxParams

type InsertAuditOutboxParams struct {
	At         time.Time
	OrgID      string
	AgentID    string
	ItemID     string
	Action     string
	Decision   string
	Reason     string
	ApprovalID string
}

type InsertAuditParams

type InsertAuditParams struct {
	At         time.Time
	OrgID      string
	AgentID    string
	ItemID     string
	Action     string
	Decision   string
	Reason     string
	ApprovalID string
}

type InsertRequestParams

type InsertRequestParams struct {
	ID        string
	OrgID     string
	AgentID   string
	ItemID    string
	GrantID   string
	Action    string
	CreatedAt time.Time
	ExpiresAt time.Time
}

type Item

type Item struct {
	ID        string
	OrgID     string
	Name      string
	Kind      string
	OwnerKind string
	OwnerID   string
	Uris      string
	Secret    []byte
	HasTotp   bool
	Tags      string
	Archived  bool
	HasFile   bool
	Login     string
}

type ItemByIDRow

type ItemByIDRow struct {
	ID        string
	OrgID     string
	Name      string
	Kind      string
	OwnerKind string
	OwnerID   string
	Uris      string
	HasTotp   bool
	Tags      string
	Archived  bool
	HasFile   bool
	Login     string
}

type ItemByNameParams

type ItemByNameParams struct {
	OrgID string
	Name  string
}

type ItemByNameRow

type ItemByNameRow struct {
	ID        string
	OrgID     string
	Name      string
	Kind      string
	OwnerKind string
	OwnerID   string
	Uris      string
	HasTotp   bool
	Tags      string
	Archived  bool
	HasFile   bool
	Login     string
}

type ItemOwnerRow

type ItemOwnerRow struct {
	OrgID     string
	OwnerKind string
	OwnerID   string
}

type ItemSecretOwnerRow

type ItemSecretOwnerRow struct {
	Secret    []byte
	OrgID     string
	OwnerKind string
	OwnerID   string
}

type ItemVersion

type ItemVersion struct {
	ID     int64
	ItemID string
	At     time.Time
	Secret []byte
}

type ItemVersionSecretParams

type ItemVersionSecretParams struct {
	ID     int64
	ItemID string
}

type ItemVersionsParams

type ItemVersionsParams struct {
	ItemID     string
	MaxResults int64
}

type ItemVersionsRow

type ItemVersionsRow struct {
	ID     int64
	ItemID string
	At     time.Time
}

type ListAuditFeedParams

type ListAuditFeedParams struct {
	OrgID      string
	AfterID    int64
	MaxResults int64
}

type ListItemsRow

type ListItemsRow struct {
	ID        string
	OrgID     string
	Name      string
	Kind      string
	OwnerKind string
	OwnerID   string
	Uris      string
	HasTotp   bool
	Tags      string
	Archived  bool
	HasFile   bool
	Login     string
}

type ListOpenRequestsParams

type ListOpenRequestsParams struct {
	OrgID      string
	Now        time.Time
	MaxResults int64
}

type ListRequestsByStatusParams

type ListRequestsByStatusParams struct {
	OrgID      string
	Status     string
	MaxResults int64
}

type LiveGrantForApproveParams

type LiveGrantForApproveParams struct {
	GrantID string
	At      time.Time
}

type MarkUsageReportedParams

type MarkUsageReportedParams struct {
	Amount      int64
	OrgID       string
	WindowStart time.Time
}

type OpenRequestByGrantParams

type OpenRequestByGrantParams struct {
	GrantID string
	Action  string
}

type OrgBilling

type OrgBilling struct {
	OrgID            string
	Plan             string
	CustomerID       string
	BillingAccountID string
	UpdatedAt        time.Time
}

type OrgKey

type OrgKey struct {
	OrgID      string
	Wrapped    []byte
	KeyVersion int32
	CmkID      sql.NullString
	CreatedAt  time.Time
	RotatedAt  sql.NullTime
}

type OwnerKey

type OwnerKey struct {
	OrgID     string
	OwnerKind string
	OwnerID   string
	Wrapped   []byte
}

type OwnerWrappedParams

type OwnerWrappedParams struct {
	OrgID     string
	OwnerKind string
	OwnerID   string
}

type PlantHumanParams

type PlantHumanParams struct {
	ID    string
	OrgID string
}

type PutAgentParams

type PutAgentParams struct {
	ID        string
	OrgID     string
	OwnerKind string
	OwnerID   string
	RevokedAt sql.NullTime
}

type PutApprovalParams

type PutApprovalParams struct {
	GrantID   string
	ID        string
	HumanID   string
	ExpiresAt time.Time
}

type PutGrantParams

type PutGrantParams struct {
	ID          string
	OrgID       string
	AgentID     string
	SubjectKind string
	ItemID      string
	Level       string
	Actions     string
	ExpiresAt   sql.NullTime
}

type PutGroupMemberParams

type PutGroupMemberParams struct {
	GroupID    string
	MemberKind string
	MemberID   string
}

type PutGroupParams

type PutGroupParams struct {
	ID    string
	OrgID string
	Name  string
}

type PutHumanParams

type PutHumanParams struct {
	ID    string
	OrgID string
}

type PutItemParams

type PutItemParams struct {
	ID        string
	OrgID     string
	Name      string
	Kind      string
	OwnerKind string
	OwnerID   string
	Uris      string
	Secret    []byte
	HasTotp   bool
	Tags      string
	Archived  bool
	HasFile   bool
	Login     string
}

type PutOrgKeyParams

type PutOrgKeyParams struct {
	OrgID      string
	Wrapped    []byte
	KeyVersion int32
	CmkID      sql.NullString
	CreatedAt  time.Time
}

type PutOwnerWrappedParams

type PutOwnerWrappedParams struct {
	OrgID     string
	OwnerKind string
	OwnerID   string
	Wrapped   []byte
}

type PutRecoveryWrapParams

type PutRecoveryWrapParams struct {
	OrgID     string
	OwnerKind string
	OwnerID   string
	Wrapped   []byte
	CreatedAt time.Time
	ExpiresAt sql.NullTime
}

type PutSessionParams

type PutSessionParams struct {
	ID         string
	OrgID      string
	AgentID    string
	SecretHash []byte
	ExpiresAt  time.Time
	CreatedAt  time.Time
	RevokedAt  sql.NullTime
	RenewedAt  sql.NullTime
	Ttl        int64
	MaxTtl     int64
	MaxUses    int32
	Uses       int32
}

type PutWorkloadParams

type PutWorkloadParams struct {
	Issuer   string
	Subject  string
	OrgID    string
	AgentID  string
	Audience string
	Claims   string
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AgentByID

func (q *Queries) AgentByID(ctx context.Context, id string) (Agent, error)

func (*Queries) ApprovalByGrant

func (q *Queries) ApprovalByGrant(ctx context.Context, grantID string) (Approval, error)

func (*Queries) ApproveOpenRequest

func (q *Queries) ApproveOpenRequest(ctx context.Context, arg ApproveOpenRequestParams) (ApprovalRequest, error)

Request-scoped approve: the ask must be open AND unexpired AND its grant still live — grant unexpired, agent unrevoked, item not archived. Approving a dead edge would mint a useless approval and a misleading 'approved' resolution.

func (*Queries) ApproveRequestsForGrant

func (q *Queries) ApproveRequestsForGrant(ctx context.Context, arg ApproveRequestsForGrantParams) ([]ApprovalRequest, error)

func (*Queries) ArchiveItem

func (q *Queries) ArchiveItem(ctx context.Context, id string) (int64, error)

func (*Queries) BumpOrgKey

func (q *Queries) BumpOrgKey(ctx context.Context, arg BumpOrgKeyParams) (int64, error)

func (*Queries) CancelRequestsForAgent

func (q *Queries) CancelRequestsForAgent(ctx context.Context, arg CancelRequestsForAgentParams) ([]ApprovalRequest, error)

func (*Queries) CancelRequestsForItem

func (q *Queries) CancelRequestsForItem(ctx context.Context, arg CancelRequestsForItemParams) ([]ApprovalRequest, error)

Returns cancelled rows so the caller can write request_cancelled events in the same transaction — an ask must never vanish without an audit line.

func (*Queries) ClaimAuditOutbox

func (q *Queries) ClaimAuditOutbox(ctx context.Context, maxResults int64) ([]AuditOutbox, error)

func (*Queries) ConsumeRecoveryWrap

func (q *Queries) ConsumeRecoveryWrap(ctx context.Context, arg ConsumeRecoveryWrapParams) (int64, error)

func (*Queries) ConsumeSession

func (q *Queries) ConsumeSession(ctx context.Context, arg ConsumeSessionParams) (ConsumeSessionRow, error)

func (*Queries) ConsumeUse

func (q *Queries) ConsumeUse(ctx context.Context, arg ConsumeUseParams) (int64, error)

The claim and the read are one atomic statement: concurrent callers each get a distinct used value; over-cap claims still land so blocked demand is visible in the counter.

func (*Queries) DeleteGroupMember

func (q *Queries) DeleteGroupMember(ctx context.Context, arg DeleteGroupMemberParams) error

func (*Queries) DeleteItem

func (q *Queries) DeleteItem(ctx context.Context, id string) (int64, error)

func (*Queries) DeleteItemGrants

func (q *Queries) DeleteItemGrants(ctx context.Context, itemID string) error

func (*Queries) DeleteItemVersions

func (q *Queries) DeleteItemVersions(ctx context.Context, itemID string) error

func (*Queries) DeleteRecoveryWrapsForOrg

func (q *Queries) DeleteRecoveryWrapsForOrg(ctx context.Context, orgID string) error

func (*Queries) DeleteWorkload

func (q *Queries) DeleteWorkload(ctx context.Context, arg DeleteWorkloadParams) error

func (*Queries) ExpireOpenRequest

func (q *Queries) ExpireOpenRequest(ctx context.Context, arg ExpireOpenRequestParams) (string, error)

func (*Queries) ExpireStaleRequests

func (q *Queries) ExpireStaleRequests(ctx context.Context, at time.Time) ([]ApprovalRequest, error)

Returns the rows it expired so the sweep can audit each request_expired — "nobody answered in time" is a security event, not hygiene.

func (*Queries) GetOrgBilling

func (q *Queries) GetOrgBilling(ctx context.Context, orgID string) (OrgBilling, error)

func (*Queries) GetOrgIDByBillingCustomer

func (q *Queries) GetOrgIDByBillingCustomer(ctx context.Context, customerID string) (string, error)

func (*Queries) GetUsage

func (q *Queries) GetUsage(ctx context.Context, arg GetUsageParams) (int64, error)

func (*Queries) GetUsageReportPending

func (q *Queries) GetUsageReportPending(ctx context.Context, lim int64) ([]GetUsageReportPendingRow, error)

The dual-write backlog: local deltas the flusher owes the provider. The billing link is a left join — unlinked orgs still appear so the flusher can provision the link before sending.

func (*Queries) GrantByID

func (q *Queries) GrantByID(ctx context.Context, id string) (Grant, error)

func (*Queries) GrantFor

func (q *Queries) GrantFor(ctx context.Context, arg GrantForParams) (Grant, error)

func (*Queries) GroupByID

func (q *Queries) GroupByID(ctx context.Context, id string) (Group, error)

func (*Queries) GroupIDsFor

func (q *Queries) GroupIDsFor(ctx context.Context, keys []string) ([]string, error)

The principal's group set: every membership edge naming one of the candidate members (the principal itself plus its user owner for agents). Keys are "kind:id" pairs so the two legs stay paired.

func (*Queries) GroupMembers

func (q *Queries) GroupMembers(ctx context.Context, groupID string) ([]GroupMember, error)

func (*Queries) HumanByID

func (q *Queries) HumanByID(ctx context.Context, id string) (Human, error)

func (*Queries) InsertAudit

func (q *Queries) InsertAudit(ctx context.Context, arg InsertAuditParams) error

func (*Queries) InsertAuditOutbox

func (q *Queries) InsertAuditOutbox(ctx context.Context, arg InsertAuditOutboxParams) error

func (*Queries) InsertRequest

func (q *Queries) InsertRequest(ctx context.Context, arg InsertRequestParams) (ApprovalRequest, error)

func (*Queries) ItemByID

func (q *Queries) ItemByID(ctx context.Context, id string) (ItemByIDRow, error)

func (*Queries) ItemByName

func (q *Queries) ItemByName(ctx context.Context, arg ItemByNameParams) (ItemByNameRow, error)

func (*Queries) ItemOwner

func (q *Queries) ItemOwner(ctx context.Context, id string) (ItemOwnerRow, error)

func (*Queries) ItemSecretOwner

func (q *Queries) ItemSecretOwner(ctx context.Context, id string) (ItemSecretOwnerRow, error)

func (*Queries) ItemVersionSecret

func (q *Queries) ItemVersionSecret(ctx context.Context, arg ItemVersionSecretParams) ([]byte, error)

func (*Queries) ItemVersions

func (q *Queries) ItemVersions(ctx context.Context, arg ItemVersionsParams) ([]ItemVersionsRow, error)

func (*Queries) ListAgents

func (q *Queries) ListAgents(ctx context.Context, maxResults int64) ([]Agent, error)

func (*Queries) ListAudit

func (q *Queries) ListAudit(ctx context.Context, maxResults int64) ([]Audit, error)

Outbox rows union in: claim-delete and audit-insert commit in one tx, so an event can never appear in both tables at once — queued events are visible immediately without double-counting.

func (*Queries) ListAuditFeed

func (q *Queries) ListAuditFeed(ctx context.Context, arg ListAuditFeedParams) ([]Audit, error)

Per-org committed-event feed for the customer SIEM pull (VEIL-55). Committed `audit` rows only — outbox rows renumber on relay, so including them would break the id keyset. id order is append order on the shared sequence.

func (*Queries) ListGrants

func (q *Queries) ListGrants(ctx context.Context, maxResults int64) ([]Grant, error)

func (*Queries) ListGroups

func (q *Queries) ListGroups(ctx context.Context, maxResults int64) ([]Group, error)

func (*Queries) ListHumans

func (q *Queries) ListHumans(ctx context.Context, maxResults int64) ([]Human, error)

func (*Queries) ListItems

func (q *Queries) ListItems(ctx context.Context, maxResults int64) ([]ListItemsRow, error)

func (*Queries) ListOpenRequests

func (q *Queries) ListOpenRequests(ctx context.Context, arg ListOpenRequestsParams) ([]ApprovalRequest, error)

func (*Queries) ListOrgKeys

func (q *Queries) ListOrgKeys(ctx context.Context) ([]OrgKey, error)

func (*Queries) ListOwnerKeysForOrg

func (q *Queries) ListOwnerKeysForOrg(ctx context.Context, orgID string) ([]OwnerKey, error)

func (*Queries) ListRequestsByStatus

func (q *Queries) ListRequestsByStatus(ctx context.Context, arg ListRequestsByStatusParams) ([]ApprovalRequest, error)

func (*Queries) ListSessions

func (q *Queries) ListSessions(ctx context.Context, maxResults int64) ([]Session, error)

func (*Queries) LiveGrantForApprove

func (q *Queries) LiveGrantForApprove(ctx context.Context, arg LiveGrantForApproveParams) (string, error)

Grant-scoped approve (`veil approve GRANT_ID`) must fail on a dead edge — expired grant, revoked agent, or archived item — rather than mint an approval that can never be used.

func (*Queries) MarkUsageReported

func (q *Queries) MarkUsageReported(ctx context.Context, arg MarkUsageReportedParams) error

func (*Queries) OpenRequestByGrant

func (q *Queries) OpenRequestByGrant(ctx context.Context, arg OpenRequestByGrantParams) (ApprovalRequest, error)

func (*Queries) OrgKey

func (q *Queries) OrgKey(ctx context.Context, orgID string) (OrgKey, error)

func (*Queries) OrgKeyForShare

func (q *Queries) OrgKeyForShare(ctx context.Context, orgID string) (OrgKey, error)

func (*Queries) OrgKeyForUpdate

func (q *Queries) OrgKeyForUpdate(ctx context.Context, orgID string) (OrgKey, error)

func (*Queries) OwnerWrapped

func (q *Queries) OwnerWrapped(ctx context.Context, arg OwnerWrappedParams) ([]byte, error)

func (*Queries) PlantHuman

func (q *Queries) PlantHuman(ctx context.Context, arg PlantHumanParams) (int64, error)

func (*Queries) PutAgent

func (q *Queries) PutAgent(ctx context.Context, arg PutAgentParams) error

func (*Queries) PutApproval

func (q *Queries) PutApproval(ctx context.Context, arg PutApprovalParams) error

func (*Queries) PutGrant

func (q *Queries) PutGrant(ctx context.Context, arg PutGrantParams) error

func (*Queries) PutGroup

func (q *Queries) PutGroup(ctx context.Context, arg PutGroupParams) error

func (*Queries) PutGroupMember

func (q *Queries) PutGroupMember(ctx context.Context, arg PutGroupMemberParams) error

func (*Queries) PutHuman

func (q *Queries) PutHuman(ctx context.Context, arg PutHumanParams) error

func (*Queries) PutItem

func (q *Queries) PutItem(ctx context.Context, arg PutItemParams) (int64, error)

func (*Queries) PutOrgKey

func (q *Queries) PutOrgKey(ctx context.Context, arg PutOrgKeyParams) (int64, error)

func (*Queries) PutOwnerWrapped

func (q *Queries) PutOwnerWrapped(ctx context.Context, arg PutOwnerWrappedParams) error

func (*Queries) PutRecoveryWrap

func (q *Queries) PutRecoveryWrap(ctx context.Context, arg PutRecoveryWrapParams) error

func (*Queries) PutSession

func (q *Queries) PutSession(ctx context.Context, arg PutSessionParams) error

func (*Queries) PutWorkload

func (q *Queries) PutWorkload(ctx context.Context, arg PutWorkloadParams) (int64, error)

func (*Queries) RecoveryWrap

func (q *Queries) RecoveryWrap(ctx context.Context, arg RecoveryWrapParams) (RecoveryWrap, error)

func (*Queries) RenewSession

func (q *Queries) RenewSession(ctx context.Context, arg RenewSessionParams) error

func (*Queries) RequestByID

func (q *Queries) RequestByID(ctx context.Context, id string) (ApprovalRequest, error)

func (*Queries) ResolveOpenRequest

func (q *Queries) ResolveOpenRequest(ctx context.Context, arg ResolveOpenRequestParams) (ApprovalRequest, error)

func (*Queries) RestoreItemSecret

func (q *Queries) RestoreItemSecret(ctx context.Context, arg RestoreItemSecretParams) error

func (*Queries) RevokeAgent

func (q *Queries) RevokeAgent(ctx context.Context, arg RevokeAgentParams) (int64, error)

func (*Queries) RevokeSession

func (q *Queries) RevokeSession(ctx context.Context, arg RevokeSessionParams) (int64, error)

func (*Queries) RewrapOrgKey

func (q *Queries) RewrapOrgKey(ctx context.Context, arg RewrapOrgKeyParams) (int64, error)

func (*Queries) RewrapOwnerKey

func (q *Queries) RewrapOwnerKey(ctx context.Context, arg RewrapOwnerKeyParams) (int64, error)

func (*Queries) SessionByHash

func (q *Queries) SessionByHash(ctx context.Context, secretHash []byte) (Session, error)

func (*Queries) SessionByID

func (q *Queries) SessionByID(ctx context.Context, id string) (Session, error)

func (*Queries) SnapshotItem

func (q *Queries) SnapshotItem(ctx context.Context, arg SnapshotItemParams) error

func (*Queries) SweepExpiredApprovals

func (q *Queries) SweepExpiredApprovals(ctx context.Context, before time.Time) (int64, error)

func (*Queries) SweepExpiredGrants

func (q *Queries) SweepExpiredGrants(ctx context.Context, before time.Time) (int64, error)

func (*Queries) SweepExpiredSessions

func (q *Queries) SweepExpiredSessions(ctx context.Context, before time.Time) (int64, error)

func (*Queries) UpsertOrgBilling

func (q *Queries) UpsertOrgBilling(ctx context.Context, arg UpsertOrgBillingParams) error
func (q *Queries) UpsertOrgBillingLink(ctx context.Context, arg UpsertOrgBillingLinkParams) error

The provisioning seam writes only the link — plan and updated_at belong to the webhook receiver (updated_at is its staleness anchor).

func (*Queries) UseAuth

func (q *Queries) UseAuth(ctx context.Context, arg UseAuthParams) (UseAuthRow, error)

The grant leg is picked by a LATERAL scalar: the principal's direct grant, else a grant to a group the principal holds membership in (its own rows plus, for a user-owned agent, the owner's). Precedence inside the candidate set: direct beats group, deny beats allow, a grant that resolves now (level2 or carrying a live approval) beats a bare level1.

func (*Queries) UseAuthSession

func (q *Queries) UseAuthSession(ctx context.Context, arg UseAuthSessionParams) (UseAuthSessionRow, error)

func (*Queries) WithTx

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

func (*Queries) WorkloadByKey

func (q *Queries) WorkloadByKey(ctx context.Context, arg WorkloadByKeyParams) (Workload, error)

func (*Queries) WorkloadsForAgent

func (q *Queries) WorkloadsForAgent(ctx context.Context, arg WorkloadsForAgentParams) ([]Workload, error)

func (*Queries) WorkloadsForIssuer

func (q *Queries) WorkloadsForIssuer(ctx context.Context, arg WorkloadsForIssuerParams) ([]Workload, error)

type RecoveryWrap

type RecoveryWrap struct {
	OrgID     string
	OwnerKind string
	OwnerID   string
	Wrapped   []byte
	CreatedAt time.Time
	ExpiresAt sql.NullTime
	UsedAt    sql.NullTime
}

type RecoveryWrapParams

type RecoveryWrapParams struct {
	OrgID     string
	OwnerKind string
	OwnerID   string
}

type RenewSessionParams

type RenewSessionParams struct {
	ExpiresAt time.Time
	RenewedAt time.Time
	ID        string
}

type ResolveOpenRequestParams

type ResolveOpenRequestParams struct {
	Status     string
	At         time.Time
	HumanID    string
	ApprovalID sql.NullString
	ID         string
}

type RestoreItemSecretParams

type RestoreItemSecretParams struct {
	Secret []byte
	ID     string
}

type RevokeAgentParams

type RevokeAgentParams struct {
	At time.Time
	ID string
}

type RevokeSessionParams

type RevokeSessionParams struct {
	At time.Time
	ID string
}

type RewrapOrgKeyParams

type RewrapOrgKeyParams struct {
	Wrapped []byte
	OrgID   string
}

type RewrapOwnerKeyParams

type RewrapOwnerKeyParams struct {
	Wrapped   []byte
	OrgID     string
	OwnerKind string
	OwnerID   string
}

type Session

type Session struct {
	ID         string
	OrgID      string
	AgentID    string
	SecretHash []byte
	ExpiresAt  time.Time
	CreatedAt  time.Time
	RevokedAt  sql.NullTime
	RenewedAt  sql.NullTime
	Ttl        int64
	MaxTtl     int64
	MaxUses    int32
	Uses       int32
}

type SnapshotItemParams

type SnapshotItemParams struct {
	ItemID string
	At     time.Time
}

type UpsertOrgBillingLinkParams

type UpsertOrgBillingLinkParams struct {
	OrgID            string
	CustomerID       string
	BillingAccountID string
}

type UpsertOrgBillingParams

type UpsertOrgBillingParams struct {
	OrgID            string
	Plan             string
	CustomerID       string
	BillingAccountID string
	UpdatedAt        time.Time
}

type UsageCounter

type UsageCounter struct {
	OrgID       string
	WindowStart time.Time
	Used        int64
	Reported    int64
}

type UseAuthParams

type UseAuthParams struct {
	AgentID string
	ItemID  string
	Now     time.Time
}

type UseAuthRow

type UseAuthRow struct {
	AgentID           sql.NullString
	AgentOrgID        sql.NullString
	AgentOwnerKind    sql.NullString
	AgentOwnerID      sql.NullString
	AgentRevokedAt    sql.NullTime
	ItemID            sql.NullString
	ItemOrgID         sql.NullString
	ItemName          sql.NullString
	ItemKind          sql.NullString
	ItemOwnerKind     sql.NullString
	ItemOwnerID       sql.NullString
	ItemUris          sql.NullString
	ItemHasTotp       sql.NullBool
	ItemTags          sql.NullString
	ItemArchived      sql.NullBool
	ItemHasFile       sql.NullBool
	ItemLogin         sql.NullString
	GrantID           sql.NullString
	GrantOrgID        sql.NullString
	GrantAgentID      sql.NullString
	GrantSubjectKind  sql.NullString
	GrantItemID       sql.NullString
	GrantLevel        sql.NullString
	GrantActions      sql.NullString
	GrantExpiresAt    sql.NullTime
	ApprovalID        sql.NullString
	ApprovalGrantID   sql.NullString
	ApprovalHumanID   sql.NullString
	ApprovalExpiresAt sql.NullTime
	GroupIds          []string
}

type UseAuthSessionParams

type UseAuthSessionParams struct {
	SessionHash []byte
	ItemID      string
	Now         time.Time
}

type UseAuthSessionRow

type UseAuthSessionRow struct {
	SessionID         sql.NullString
	AgentID           sql.NullString
	AgentOrgID        sql.NullString
	AgentOwnerKind    sql.NullString
	AgentOwnerID      sql.NullString
	AgentRevokedAt    sql.NullTime
	ItemID            sql.NullString
	ItemOrgID         sql.NullString
	ItemName          sql.NullString
	ItemKind          sql.NullString
	ItemOwnerKind     sql.NullString
	ItemOwnerID       sql.NullString
	ItemUris          sql.NullString
	ItemHasTotp       sql.NullBool
	ItemTags          sql.NullString
	ItemArchived      sql.NullBool
	ItemHasFile       sql.NullBool
	ItemLogin         sql.NullString
	GrantID           sql.NullString
	GrantOrgID        sql.NullString
	GrantAgentID      sql.NullString
	GrantSubjectKind  sql.NullString
	GrantItemID       sql.NullString
	GrantLevel        sql.NullString
	GrantActions      sql.NullString
	GrantExpiresAt    sql.NullTime
	ApprovalID        sql.NullString
	ApprovalGrantID   sql.NullString
	ApprovalHumanID   sql.NullString
	ApprovalExpiresAt sql.NullTime
	GroupIds          []string
}

type Workload

type Workload struct {
	Issuer   string
	Subject  string
	OrgID    string
	AgentID  string
	Audience string
	Claims   string
}

type WorkloadByKeyParams

type WorkloadByKeyParams struct {
	Issuer  string
	Subject string
}

type WorkloadsForAgentParams

type WorkloadsForAgentParams struct {
	AgentID    string
	MaxResults int64
}

type WorkloadsForIssuerParams

type WorkloadsForIssuerParams struct {
	Issuer     string
	MaxResults int64
}

Jump to

Keyboard shortcuts

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