dbgen

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: AGPL-3.0 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 ActivateKeyParams

type ActivateKeyParams struct {
	KeyID            string
	ActivatedAt      time.Time
	CanaryCiphertext []byte
	PreviousKeyID    string
}

type CountEncryptedValuesByKeyRow

type CountEncryptedValuesByKeyRow struct {
	KeyID     pgtype.Text
	Encrypted int64
}

type CountOpenButtonKeysParams

type CountOpenButtonKeysParams struct {
	OrgID      int64
	EndedSince time.Time
}

type CountOpenButtonKeysRow

type CountOpenButtonKeysRow struct {
	KeyID    string
	Messages int64
}

type CountOpenDeliveriesSignedByOtherKeyParams

type CountOpenDeliveriesSignedByOtherKeyParams struct {
	OrgID int64
	KeyID string
}

type CreateKeyringStateParams

type CreateKeyringStateParams struct {
	ActiveKeyID      string
	ActivatedAt      time.Time
	CanaryCiphertext []byte
}

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 GetKeyringStateRow

type GetKeyringStateRow struct {
	ActiveKeyID      string
	ActivatedAt      time.Time
	CanaryCiphertext []byte
	CanaryKeyID      string
}

type ListActivatedKeysRow

type ListActivatedKeysRow struct {
	BeforeKeyID string
	AfterKeyID  string
}

type ListRotateBotTokenParams

type ListRotateBotTokenParams struct {
	OrgID int64
	KeyID string
}

type ListRotateBotTokenRow

type ListRotateBotTokenRow struct {
	ID         int64
	Ciphertext []byte
	KeyID      string
}

type ListRotateBridgePushSecretParams

type ListRotateBridgePushSecretParams struct {
	OrgID int64
	KeyID string
}

type ListRotateBridgePushSecretRow

type ListRotateBridgePushSecretRow struct {
	ID         int64
	Ciphertext []byte
	KeyID      string
}

type ListRotateConnectionProxyPasswordParams

type ListRotateConnectionProxyPasswordParams struct {
	OrgID int64
	KeyID string
}

type ListRotateConnectionProxyPasswordRow

type ListRotateConnectionProxyPasswordRow struct {
	ID         int64
	Ciphertext []byte
	KeyID      string
}

type ListRotateDestinationProxyPasswordParams

type ListRotateDestinationProxyPasswordParams struct {
	OrgID int64
	KeyID string
}

type ListRotateDestinationProxyPasswordRow

type ListRotateDestinationProxyPasswordRow struct {
	ID         int64
	Ciphertext []byte
	KeyID      string
}

type ListRotateDestinationSecretParams

type ListRotateDestinationSecretParams struct {
	OrgID int64
	KeyID string
}

type ListRotateDestinationSecretRow

type ListRotateDestinationSecretRow struct {
	DestinationID int64
	Name          string
	Ciphertext    []byte
	KeyID         string
}

type ListRotateHeartbeatProxyPasswordParams

type ListRotateHeartbeatProxyPasswordParams struct {
	OrgID int64
	KeyID string
}

type ListRotateHeartbeatProxyPasswordRow

type ListRotateHeartbeatProxyPasswordRow struct {
	ID         int64
	Ciphertext []byte
	KeyID      string
}

type ListRotateHeartbeatURLParams

type ListRotateHeartbeatURLParams struct {
	OrgID int64
	KeyID string
}

type ListRotateHeartbeatURLRow

type ListRotateHeartbeatURLRow struct {
	ID         int64
	Ciphertext []byte
	KeyID      string
}

type ListRotateOIDCClientSecretParams

type ListRotateOIDCClientSecretParams struct {
	OrgID int64
	KeyID string
}

type ListRotateOIDCClientSecretRow

type ListRotateOIDCClientSecretRow struct {
	OrgID      int64
	Ciphertext []byte
	KeyID      string
}

type ListRotateOIDCCodeVerifierParams

type ListRotateOIDCCodeVerifierParams struct {
	OrgID int64
	KeyID string
}

type ListRotateOIDCCodeVerifierRow

type ListRotateOIDCCodeVerifierRow struct {
	StateHash  []byte
	Ciphertext []byte
	KeyID      string
}

type ListRotateOIDCProxyPasswordParams

type ListRotateOIDCProxyPasswordParams struct {
	OrgID int64
	KeyID string
}

type ListRotateOIDCProxyPasswordRow

type ListRotateOIDCProxyPasswordRow struct {
	OrgID      int64
	Ciphertext []byte
	KeyID      string
}

type ListRotateOfflineTokenParams

type ListRotateOfflineTokenParams struct {
	OrgID int64
	KeyID string
}

type ListRotateOfflineTokenRow

type ListRotateOfflineTokenRow struct {
	ID         int64
	Ciphertext []byte
	KeyID      string
}

type ListRotatePreviousSigningSecretParams

type ListRotatePreviousSigningSecretParams struct {
	OrgID int64
	KeyID string
}

type ListRotatePreviousSigningSecretRow

type ListRotatePreviousSigningSecretRow struct {
	ID         int64
	Ciphertext []byte
	KeyID      string
}

type ListRotateSigningSecretParams

type ListRotateSigningSecretParams struct {
	OrgID int64
	KeyID string
}

type ListRotateSigningSecretRow

type ListRotateSigningSecretRow struct {
	ID         int64
	Ciphertext []byte
	KeyID      string
}

type ListRotateSlackAppTokenParams

type ListRotateSlackAppTokenParams struct {
	OrgID int64
	KeyID string
}

type ListRotateSlackAppTokenRow

type ListRotateSlackAppTokenRow struct {
	ID         int64
	Ciphertext []byte
	KeyID      string
}

type ListRotateSlackSigningSecretParams

type ListRotateSlackSigningSecretParams struct {
	OrgID int64
	KeyID string
}

type ListRotateSlackSigningSecretRow

type ListRotateSlackSigningSecretRow struct {
	ID         int64
	Ciphertext []byte
	KeyID      string
}

type ListRotateTOTPPendingSeedParams

type ListRotateTOTPPendingSeedParams struct {
	OrgID int64
	KeyID string
}

type ListRotateTOTPPendingSeedRow

type ListRotateTOTPPendingSeedRow struct {
	UserID     int64
	Ciphertext []byte
	KeyID      string
}

type ListRotateTOTPSeedParams

type ListRotateTOTPSeedParams struct {
	OrgID int64
	KeyID string
}

type ListRotateTOTPSeedRow

type ListRotateTOTPSeedRow struct {
	UserID     int64
	Ciphertext []byte
	KeyID      string
}

type ListRotateTelegramWebhookSecretParams

type ListRotateTelegramWebhookSecretParams struct {
	OrgID int64
	KeyID string
}

type ListRotateTelegramWebhookSecretRow

type ListRotateTelegramWebhookSecretRow struct {
	ID         int64
	Ciphertext []byte
	KeyID      string
}

type NotifyKeyringParams

type NotifyKeyringParams struct {
	Channel string
	Payload string
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) ActivateKey

func (q *Queries) ActivateKey(ctx context.Context, arg ActivateKeyParams) (int64, error)

ActivateKey makes @key_id the active key at @activated_at with the canary re-encrypted with it, in the transaction that re-encrypts every Secret; no row when the active key is no longer @previous_key_id.

func (*Queries) CountEncryptedValuesByKey

func (q *Queries) CountEncryptedValuesByKey(ctx context.Context, orgID int64) ([]CountEncryptedValuesByKeyRow, error)

CountEncryptedValuesByKey counts the Organization's encrypted values by the key that encrypted them.

func (*Queries) CountOpenButtonKeys

func (q *Queries) CountOpenButtonKeys(ctx context.Context, arg CountOpenButtonKeysParams) ([]CountOpenButtonKeysRow, error)

CountOpenButtonKeys counts, by key id, the Root messages of the Organization's open Alert Groups whose buttons that key signed (C-20.FR-6): the current one of each delivery, and every older one a republication past a bridge's edit window replaced, whose buttons still work (C-22.FR-9). A delivery deleted in the messenger, retired or withheld depends on nothing: the re-render after a rotation never re-signs it. It counts with them the calls through Notification gateways whose action data that key signed (C-30.FR-6) while the gateway may still report an acknowledgement of it, through a gateway and to a person not deleted: those waiting or being sent, and those accepted, or Not delivered after an attempt, which may have rung, that ended at or after @ended_since — the business time less twice bridge.event_max_age (keyring.CallKeyWindow): an acknowledgement is dropped once it is older than that age, and the person may press it as long again after the call ended, while it rings or the gateway retries it — while any of their Alert Groups is open. A waiting call has no key id yet, since StartCall signs it as it becomes sending; waiting is listed so that the rule reads as its contract.

func (*Queries) CountOpenDeliveriesSignedByOtherKey

func (q *Queries) CountOpenDeliveriesSignedByOtherKey(ctx context.Context, arg CountOpenDeliveriesSignedByOtherKeyParams) (int64, error)

CountOpenDeliveriesSignedByOtherKey counts the deliveries of the Organization's open Alert Groups whose Desired state has buttons signed by a key other than @key_id and that the Leader re-renders after an activation (the selection of the delivery package's ListRerenderGroups): pending or delivered, or Not delivered with a Root message, and no final edit.

func (*Queries) CreateKeyringState

func (q *Queries) CreateKeyringState(ctx context.Context, arg CreateKeyringStateParams) (int64, error)

CreateKeyringState writes the first active key and its canary; it changes nothing when a row exists.

func (*Queries) DeleteReplica

func (q *Queries) DeleteReplica(ctx context.Context, replicaID string) error

func (*Queries) GetActiveKeyID

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

func (*Queries) GetKeyringState

func (q *Queries) GetKeyringState(ctx context.Context) (GetKeyringStateRow, error)

SPDX-License-Identifier: AGPL-3.0-only Copyright The Muster Authors

func (*Queries) ListActivatedKeys

func (q *Queries) ListActivatedKeys(ctx context.Context, orgID int64) ([]ListActivatedKeysRow, error)

ListActivatedKeys reads the before and after values of /active_key_id in the Organization's keyring.key_activated Audit entries: every key named there was active before (C-20.FR-6).

func (*Queries) ListLiveReplicas

func (q *Queries) ListLiveReplicas(ctx context.Context, liveSince time.Time) ([]Replica, error)

func (*Queries) ListOrganizationIDs

func (q *Queries) ListOrganizationIDs(ctx context.Context) ([]int64, error)

func (*Queries) ListRotateBotToken

func (q *Queries) ListRotateBotToken(ctx context.Context, arg ListRotateBotTokenParams) ([]ListRotateBotTokenRow, error)

func (*Queries) ListRotateBridgePushSecret

func (q *Queries) ListRotateBridgePushSecret(ctx context.Context, arg ListRotateBridgePushSecretParams) ([]ListRotateBridgePushSecretRow, error)

func (*Queries) ListRotateHeartbeatURL

func (q *Queries) ListRotateHeartbeatURL(ctx context.Context, arg ListRotateHeartbeatURLParams) ([]ListRotateHeartbeatURLRow, error)

The re-encryption of `muster secrets rotate-key`: for every field of the encrypted_values view, the values of the Organization that another key encrypted, locked, and the update of one value with its new ciphertext and key id. An update keeps the field's *_updated_at (previous_signing_secret_since for the previous Signing secret): the Secret itself did not change.

func (*Queries) ListRotateOIDCClientSecret

func (q *Queries) ListRotateOIDCClientSecret(ctx context.Context, arg ListRotateOIDCClientSecretParams) ([]ListRotateOIDCClientSecretRow, error)

func (*Queries) ListRotateOIDCCodeVerifier

func (q *Queries) ListRotateOIDCCodeVerifier(ctx context.Context, arg ListRotateOIDCCodeVerifierParams) ([]ListRotateOIDCCodeVerifierRow, error)

func (*Queries) ListRotateOfflineToken

func (q *Queries) ListRotateOfflineToken(ctx context.Context, arg ListRotateOfflineTokenParams) ([]ListRotateOfflineTokenRow, error)

ListRotateOfflineToken locks the users in id order, the order in which the changes that may remove the last active Admin lock the active Admins (LockActiveAdmins); users has no other encrypted field.

func (*Queries) ListRotateSigningSecret

func (q *Queries) ListRotateSigningSecret(ctx context.Context, arg ListRotateSigningSecretParams) ([]ListRotateSigningSecretRow, error)

func (*Queries) ListRotateSlackAppToken

func (q *Queries) ListRotateSlackAppToken(ctx context.Context, arg ListRotateSlackAppTokenParams) ([]ListRotateSlackAppTokenRow, error)

func (*Queries) ListRotateTOTPPendingSeed

func (q *Queries) ListRotateTOTPPendingSeed(ctx context.Context, arg ListRotateTOTPPendingSeedParams) ([]ListRotateTOTPPendingSeedRow, error)

func (*Queries) ListRotateTOTPSeed

func (q *Queries) ListRotateTOTPSeed(ctx context.Context, arg ListRotateTOTPSeedParams) ([]ListRotateTOTPSeedRow, error)

func (*Queries) LockKeyringState

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

LockKeyringState reads and locks the active key for its activation by `muster secrets rotate-key`.

func (*Queries) LockRotateConnections

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

LockRotateConnections locks every Connection of the Organization in id order, before rotation re-encrypts their fields one by one, which alone would lock them out of id order: a save of a Team takes the Connections of its Team mentions FOR SHARE in id order.

func (*Queries) LockRotateDestinations

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

LockRotateDestinations locks every outgoing webhook of the Organization in id order, after the Connections, as LockRotateConnections does: a save of a Team takes the Destinations it names in id order after its Connections, and the deletion of a Team those it owns. Only outgoing webhooks hold encrypted values (their proxy password, Signing secrets and Destination Secrets), and only they are locked: a save of a messenger Destination locks it and then its Connection, the opposite order, which an activation holding every Connection would deadlock with.

func (*Queries) NotifyKeyring

func (q *Queries) NotifyKeyring(ctx context.Context, arg NotifyKeyringParams) error

NotifyKeyring wakes every replica on the keyring channel once the transaction commits.

func (*Queries) PruneReplicas

func (q *Queries) PruneReplicas(ctx context.Context, refreshedBefore time.Time) (int64, error)

PruneReplicas deletes the records of replicas not refreshed since refreshed_before, on the real clock.

func (*Queries) RecordReplica

func (q *Queries) RecordReplica(ctx context.Context, arg RecordReplicaParams) error

RecordReplica writes the replica's record at start and refreshes it; a pruned record comes back. started_at moves when the replica re-registers after it lost the database.

func (*Queries) ReencryptBotToken

func (q *Queries) ReencryptBotToken(ctx context.Context, arg ReencryptBotTokenParams) (int64, error)

func (*Queries) ReencryptBridgePushSecret

func (q *Queries) ReencryptBridgePushSecret(ctx context.Context, arg ReencryptBridgePushSecretParams) (int64, error)

func (*Queries) ReencryptConnectionProxyPassword

func (q *Queries) ReencryptConnectionProxyPassword(ctx context.Context, arg ReencryptConnectionProxyPasswordParams) (int64, error)

func (*Queries) ReencryptDestinationProxyPassword

func (q *Queries) ReencryptDestinationProxyPassword(ctx context.Context, arg ReencryptDestinationProxyPasswordParams) (int64, error)

func (*Queries) ReencryptDestinationSecret

func (q *Queries) ReencryptDestinationSecret(ctx context.Context, arg ReencryptDestinationSecretParams) (int64, error)

func (*Queries) ReencryptHeartbeatProxyPassword

func (q *Queries) ReencryptHeartbeatProxyPassword(ctx context.Context, arg ReencryptHeartbeatProxyPasswordParams) (int64, error)

func (*Queries) ReencryptHeartbeatURL

func (q *Queries) ReencryptHeartbeatURL(ctx context.Context, arg ReencryptHeartbeatURLParams) (int64, error)

func (*Queries) ReencryptOIDCClientSecret

func (q *Queries) ReencryptOIDCClientSecret(ctx context.Context, arg ReencryptOIDCClientSecretParams) (int64, error)

func (*Queries) ReencryptOIDCCodeVerifier

func (q *Queries) ReencryptOIDCCodeVerifier(ctx context.Context, arg ReencryptOIDCCodeVerifierParams) (int64, error)

func (*Queries) ReencryptOIDCProxyPassword

func (q *Queries) ReencryptOIDCProxyPassword(ctx context.Context, arg ReencryptOIDCProxyPasswordParams) (int64, error)

func (*Queries) ReencryptOfflineToken

func (q *Queries) ReencryptOfflineToken(ctx context.Context, arg ReencryptOfflineTokenParams) (int64, error)

func (*Queries) ReencryptPreviousSigningSecret

func (q *Queries) ReencryptPreviousSigningSecret(ctx context.Context, arg ReencryptPreviousSigningSecretParams) (int64, error)

func (*Queries) ReencryptSigningSecret

func (q *Queries) ReencryptSigningSecret(ctx context.Context, arg ReencryptSigningSecretParams) (int64, error)

func (*Queries) ReencryptSlackAppToken

func (q *Queries) ReencryptSlackAppToken(ctx context.Context, arg ReencryptSlackAppTokenParams) (int64, error)

func (*Queries) ReencryptSlackSigningSecret

func (q *Queries) ReencryptSlackSigningSecret(ctx context.Context, arg ReencryptSlackSigningSecretParams) (int64, error)

func (*Queries) ReencryptTOTPPendingSeed

func (q *Queries) ReencryptTOTPPendingSeed(ctx context.Context, arg ReencryptTOTPPendingSeedParams) (int64, error)

func (*Queries) ReencryptTOTPSeed

func (q *Queries) ReencryptTOTPSeed(ctx context.Context, arg ReencryptTOTPSeedParams) (int64, error)

func (*Queries) ReencryptTelegramWebhookSecret

func (q *Queries) ReencryptTelegramWebhookSecret(ctx context.Context, arg ReencryptTelegramWebhookSecretParams) (int64, error)

func (*Queries) WithTx

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

type RecordReplicaParams

type RecordReplicaParams struct {
	ReplicaID   string
	Hostname    pgtype.Text
	Version     string
	KeyIds      []string
	StartedAt   time.Time
	RefreshedAt time.Time
}

type ReencryptBotTokenParams

type ReencryptBotTokenParams struct {
	Ciphertext    []byte
	KeyID         string
	OrgID         int64
	ID            int64
	PreviousKeyID string
}

type ReencryptBridgePushSecretParams

type ReencryptBridgePushSecretParams struct {
	Ciphertext    []byte
	KeyID         string
	OrgID         int64
	ID            int64
	PreviousKeyID string
}

type ReencryptConnectionProxyPasswordParams

type ReencryptConnectionProxyPasswordParams struct {
	Ciphertext    []byte
	KeyID         string
	OrgID         int64
	ID            int64
	PreviousKeyID string
}

type ReencryptDestinationProxyPasswordParams

type ReencryptDestinationProxyPasswordParams struct {
	Ciphertext    []byte
	KeyID         string
	OrgID         int64
	ID            int64
	PreviousKeyID string
}

type ReencryptDestinationSecretParams

type ReencryptDestinationSecretParams struct {
	Ciphertext    []byte
	KeyID         string
	OrgID         int64
	DestinationID int64
	Name          string
	PreviousKeyID string
}

type ReencryptHeartbeatProxyPasswordParams

type ReencryptHeartbeatProxyPasswordParams struct {
	Ciphertext    []byte
	KeyID         string
	OrgID         int64
	PreviousKeyID string
}

type ReencryptHeartbeatURLParams

type ReencryptHeartbeatURLParams struct {
	Ciphertext    []byte
	KeyID         string
	OrgID         int64
	PreviousKeyID string
}

type ReencryptOIDCClientSecretParams

type ReencryptOIDCClientSecretParams struct {
	Ciphertext    []byte
	KeyID         string
	OrgID         int64
	PreviousKeyID string
}

type ReencryptOIDCCodeVerifierParams

type ReencryptOIDCCodeVerifierParams struct {
	Ciphertext    []byte
	KeyID         string
	OrgID         int64
	StateHash     []byte
	PreviousKeyID string
}

type ReencryptOIDCProxyPasswordParams

type ReencryptOIDCProxyPasswordParams struct {
	Ciphertext    []byte
	KeyID         string
	OrgID         int64
	PreviousKeyID string
}

type ReencryptOfflineTokenParams

type ReencryptOfflineTokenParams struct {
	Ciphertext    []byte
	KeyID         string
	OrgID         int64
	ID            int64
	PreviousKeyID string
}

type ReencryptPreviousSigningSecretParams

type ReencryptPreviousSigningSecretParams struct {
	Ciphertext    []byte
	KeyID         string
	OrgID         int64
	ID            int64
	PreviousKeyID string
}

type ReencryptSigningSecretParams

type ReencryptSigningSecretParams struct {
	Ciphertext    []byte
	KeyID         string
	OrgID         int64
	ID            int64
	PreviousKeyID string
}

type ReencryptSlackAppTokenParams

type ReencryptSlackAppTokenParams struct {
	Ciphertext    []byte
	KeyID         string
	OrgID         int64
	ID            int64
	PreviousKeyID string
}

type ReencryptSlackSigningSecretParams

type ReencryptSlackSigningSecretParams struct {
	Ciphertext    []byte
	KeyID         string
	OrgID         int64
	ID            int64
	PreviousKeyID string
}

type ReencryptTOTPPendingSeedParams

type ReencryptTOTPPendingSeedParams struct {
	Ciphertext    []byte
	KeyID         string
	OrgID         int64
	UserID        int64
	PreviousKeyID string
}

type ReencryptTOTPSeedParams

type ReencryptTOTPSeedParams struct {
	Ciphertext    []byte
	KeyID         string
	OrgID         int64
	UserID        int64
	PreviousKeyID string
}

type ReencryptTelegramWebhookSecretParams

type ReencryptTelegramWebhookSecretParams struct {
	Ciphertext    []byte
	KeyID         string
	OrgID         int64
	ID            int64
	PreviousKeyID string
}

type Replica

type Replica struct {
	ReplicaID   string
	Hostname    pgtype.Text
	Version     string
	KeyIds      []string
	StartedAt   time.Time
	RefreshedAt time.Time
}

Jump to

Keyboard shortcuts

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