Documentation
¶
Index ¶
- type ActivateKeyParams
- type CountEncryptedValuesByKeyRow
- type CountOpenButtonKeysParams
- type CountOpenButtonKeysRow
- type CountOpenDeliveriesSignedByOtherKeyParams
- type CreateKeyringStateParams
- type DBTX
- type GetKeyringStateRow
- type ListActivatedKeysRow
- type ListRotateBotTokenParams
- type ListRotateBotTokenRow
- type ListRotateBridgePushSecretParams
- type ListRotateBridgePushSecretRow
- type ListRotateConnectionProxyPasswordParams
- type ListRotateConnectionProxyPasswordRow
- type ListRotateDestinationProxyPasswordParams
- type ListRotateDestinationProxyPasswordRow
- type ListRotateDestinationSecretParams
- type ListRotateDestinationSecretRow
- type ListRotateHeartbeatProxyPasswordParams
- type ListRotateHeartbeatProxyPasswordRow
- type ListRotateHeartbeatURLParams
- type ListRotateHeartbeatURLRow
- type ListRotateOIDCClientSecretParams
- type ListRotateOIDCClientSecretRow
- type ListRotateOIDCCodeVerifierParams
- type ListRotateOIDCCodeVerifierRow
- type ListRotateOIDCProxyPasswordParams
- type ListRotateOIDCProxyPasswordRow
- type ListRotateOfflineTokenParams
- type ListRotateOfflineTokenRow
- type ListRotatePreviousSigningSecretParams
- type ListRotatePreviousSigningSecretRow
- type ListRotateSigningSecretParams
- type ListRotateSigningSecretRow
- type ListRotateSlackAppTokenParams
- type ListRotateSlackAppTokenRow
- type ListRotateSlackSigningSecretParams
- type ListRotateSlackSigningSecretRow
- type ListRotateTOTPPendingSeedParams
- type ListRotateTOTPPendingSeedRow
- type ListRotateTOTPSeedParams
- type ListRotateTOTPSeedRow
- type ListRotateTelegramWebhookSecretParams
- type ListRotateTelegramWebhookSecretRow
- type NotifyKeyringParams
- type Queries
- func (q *Queries) ActivateKey(ctx context.Context, arg ActivateKeyParams) (int64, error)
- func (q *Queries) CountEncryptedValuesByKey(ctx context.Context, orgID int64) ([]CountEncryptedValuesByKeyRow, error)
- func (q *Queries) CountOpenButtonKeys(ctx context.Context, arg CountOpenButtonKeysParams) ([]CountOpenButtonKeysRow, error)
- func (q *Queries) CountOpenDeliveriesSignedByOtherKey(ctx context.Context, arg CountOpenDeliveriesSignedByOtherKeyParams) (int64, error)
- func (q *Queries) CreateKeyringState(ctx context.Context, arg CreateKeyringStateParams) (int64, error)
- func (q *Queries) DeleteReplica(ctx context.Context, replicaID string) error
- func (q *Queries) GetActiveKeyID(ctx context.Context) (string, error)
- func (q *Queries) GetKeyringState(ctx context.Context) (GetKeyringStateRow, error)
- func (q *Queries) ListActivatedKeys(ctx context.Context, orgID int64) ([]ListActivatedKeysRow, error)
- func (q *Queries) ListLiveReplicas(ctx context.Context, liveSince time.Time) ([]Replica, error)
- func (q *Queries) ListOrganizationIDs(ctx context.Context) ([]int64, error)
- func (q *Queries) ListRotateBotToken(ctx context.Context, arg ListRotateBotTokenParams) ([]ListRotateBotTokenRow, error)
- func (q *Queries) ListRotateBridgePushSecret(ctx context.Context, arg ListRotateBridgePushSecretParams) ([]ListRotateBridgePushSecretRow, error)
- func (q *Queries) ListRotateConnectionProxyPassword(ctx context.Context, arg ListRotateConnectionProxyPasswordParams) ([]ListRotateConnectionProxyPasswordRow, error)
- func (q *Queries) ListRotateDestinationProxyPassword(ctx context.Context, arg ListRotateDestinationProxyPasswordParams) ([]ListRotateDestinationProxyPasswordRow, error)
- func (q *Queries) ListRotateDestinationSecret(ctx context.Context, arg ListRotateDestinationSecretParams) ([]ListRotateDestinationSecretRow, error)
- func (q *Queries) ListRotateHeartbeatProxyPassword(ctx context.Context, arg ListRotateHeartbeatProxyPasswordParams) ([]ListRotateHeartbeatProxyPasswordRow, error)
- func (q *Queries) ListRotateHeartbeatURL(ctx context.Context, arg ListRotateHeartbeatURLParams) ([]ListRotateHeartbeatURLRow, error)
- func (q *Queries) ListRotateOIDCClientSecret(ctx context.Context, arg ListRotateOIDCClientSecretParams) ([]ListRotateOIDCClientSecretRow, error)
- func (q *Queries) ListRotateOIDCCodeVerifier(ctx context.Context, arg ListRotateOIDCCodeVerifierParams) ([]ListRotateOIDCCodeVerifierRow, error)
- func (q *Queries) ListRotateOIDCProxyPassword(ctx context.Context, arg ListRotateOIDCProxyPasswordParams) ([]ListRotateOIDCProxyPasswordRow, error)
- func (q *Queries) ListRotateOfflineToken(ctx context.Context, arg ListRotateOfflineTokenParams) ([]ListRotateOfflineTokenRow, error)
- func (q *Queries) ListRotatePreviousSigningSecret(ctx context.Context, arg ListRotatePreviousSigningSecretParams) ([]ListRotatePreviousSigningSecretRow, error)
- func (q *Queries) ListRotateSigningSecret(ctx context.Context, arg ListRotateSigningSecretParams) ([]ListRotateSigningSecretRow, error)
- func (q *Queries) ListRotateSlackAppToken(ctx context.Context, arg ListRotateSlackAppTokenParams) ([]ListRotateSlackAppTokenRow, error)
- func (q *Queries) ListRotateSlackSigningSecret(ctx context.Context, arg ListRotateSlackSigningSecretParams) ([]ListRotateSlackSigningSecretRow, error)
- func (q *Queries) ListRotateTOTPPendingSeed(ctx context.Context, arg ListRotateTOTPPendingSeedParams) ([]ListRotateTOTPPendingSeedRow, error)
- func (q *Queries) ListRotateTOTPSeed(ctx context.Context, arg ListRotateTOTPSeedParams) ([]ListRotateTOTPSeedRow, error)
- func (q *Queries) ListRotateTelegramWebhookSecret(ctx context.Context, arg ListRotateTelegramWebhookSecretParams) ([]ListRotateTelegramWebhookSecretRow, error)
- func (q *Queries) LockKeyringState(ctx context.Context) (string, error)
- func (q *Queries) LockRotateConnections(ctx context.Context, orgID int64) error
- func (q *Queries) LockRotateDestinations(ctx context.Context, orgID int64) error
- func (q *Queries) NotifyKeyring(ctx context.Context, arg NotifyKeyringParams) error
- func (q *Queries) PruneReplicas(ctx context.Context, refreshedBefore time.Time) (int64, error)
- func (q *Queries) RecordReplica(ctx context.Context, arg RecordReplicaParams) error
- func (q *Queries) ReencryptBotToken(ctx context.Context, arg ReencryptBotTokenParams) (int64, error)
- func (q *Queries) ReencryptBridgePushSecret(ctx context.Context, arg ReencryptBridgePushSecretParams) (int64, error)
- func (q *Queries) ReencryptConnectionProxyPassword(ctx context.Context, arg ReencryptConnectionProxyPasswordParams) (int64, error)
- func (q *Queries) ReencryptDestinationProxyPassword(ctx context.Context, arg ReencryptDestinationProxyPasswordParams) (int64, error)
- func (q *Queries) ReencryptDestinationSecret(ctx context.Context, arg ReencryptDestinationSecretParams) (int64, error)
- func (q *Queries) ReencryptHeartbeatProxyPassword(ctx context.Context, arg ReencryptHeartbeatProxyPasswordParams) (int64, error)
- func (q *Queries) ReencryptHeartbeatURL(ctx context.Context, arg ReencryptHeartbeatURLParams) (int64, error)
- func (q *Queries) ReencryptOIDCClientSecret(ctx context.Context, arg ReencryptOIDCClientSecretParams) (int64, error)
- func (q *Queries) ReencryptOIDCCodeVerifier(ctx context.Context, arg ReencryptOIDCCodeVerifierParams) (int64, error)
- func (q *Queries) ReencryptOIDCProxyPassword(ctx context.Context, arg ReencryptOIDCProxyPasswordParams) (int64, error)
- func (q *Queries) ReencryptOfflineToken(ctx context.Context, arg ReencryptOfflineTokenParams) (int64, error)
- func (q *Queries) ReencryptPreviousSigningSecret(ctx context.Context, arg ReencryptPreviousSigningSecretParams) (int64, error)
- func (q *Queries) ReencryptSigningSecret(ctx context.Context, arg ReencryptSigningSecretParams) (int64, error)
- func (q *Queries) ReencryptSlackAppToken(ctx context.Context, arg ReencryptSlackAppTokenParams) (int64, error)
- func (q *Queries) ReencryptSlackSigningSecret(ctx context.Context, arg ReencryptSlackSigningSecretParams) (int64, error)
- func (q *Queries) ReencryptTOTPPendingSeed(ctx context.Context, arg ReencryptTOTPPendingSeedParams) (int64, error)
- func (q *Queries) ReencryptTOTPSeed(ctx context.Context, arg ReencryptTOTPSeedParams) (int64, error)
- func (q *Queries) ReencryptTelegramWebhookSecret(ctx context.Context, arg ReencryptTelegramWebhookSecretParams) (int64, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type RecordReplicaParams
- type ReencryptBotTokenParams
- type ReencryptBridgePushSecretParams
- type ReencryptConnectionProxyPasswordParams
- type ReencryptDestinationProxyPasswordParams
- type ReencryptDestinationSecretParams
- type ReencryptHeartbeatProxyPasswordParams
- type ReencryptHeartbeatURLParams
- type ReencryptOIDCClientSecretParams
- type ReencryptOIDCCodeVerifierParams
- type ReencryptOIDCProxyPasswordParams
- type ReencryptOfflineTokenParams
- type ReencryptPreviousSigningSecretParams
- type ReencryptSigningSecretParams
- type ReencryptSlackAppTokenParams
- type ReencryptSlackSigningSecretParams
- type ReencryptTOTPPendingSeedParams
- type ReencryptTOTPSeedParams
- type ReencryptTelegramWebhookSecretParams
- type Replica
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivateKeyParams ¶
type CountOpenButtonKeysRow ¶
type GetKeyringStateRow ¶
type ListActivatedKeysRow ¶
type ListRotateBotTokenRow ¶
type ListRotateTOTPSeedRow ¶
type NotifyKeyringParams ¶
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) ActivateKey ¶
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 (*Queries) GetActiveKeyID ¶
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 (*Queries) ListOrganizationIDs ¶
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) ListRotateConnectionProxyPassword ¶
func (q *Queries) ListRotateConnectionProxyPassword(ctx context.Context, arg ListRotateConnectionProxyPasswordParams) ([]ListRotateConnectionProxyPasswordRow, error)
func (*Queries) ListRotateDestinationProxyPassword ¶
func (q *Queries) ListRotateDestinationProxyPassword(ctx context.Context, arg ListRotateDestinationProxyPasswordParams) ([]ListRotateDestinationProxyPasswordRow, error)
func (*Queries) ListRotateDestinationSecret ¶
func (q *Queries) ListRotateDestinationSecret(ctx context.Context, arg ListRotateDestinationSecretParams) ([]ListRotateDestinationSecretRow, error)
func (*Queries) ListRotateHeartbeatProxyPassword ¶
func (q *Queries) ListRotateHeartbeatProxyPassword(ctx context.Context, arg ListRotateHeartbeatProxyPasswordParams) ([]ListRotateHeartbeatProxyPasswordRow, 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) ListRotateOIDCProxyPassword ¶
func (q *Queries) ListRotateOIDCProxyPassword(ctx context.Context, arg ListRotateOIDCProxyPasswordParams) ([]ListRotateOIDCProxyPasswordRow, 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) ListRotatePreviousSigningSecret ¶
func (q *Queries) ListRotatePreviousSigningSecret(ctx context.Context, arg ListRotatePreviousSigningSecretParams) ([]ListRotatePreviousSigningSecretRow, error)
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) ListRotateSlackSigningSecret ¶
func (q *Queries) ListRotateSlackSigningSecret(ctx context.Context, arg ListRotateSlackSigningSecretParams) ([]ListRotateSlackSigningSecretRow, 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) ListRotateTelegramWebhookSecret ¶
func (q *Queries) ListRotateTelegramWebhookSecret(ctx context.Context, arg ListRotateTelegramWebhookSecretParams) ([]ListRotateTelegramWebhookSecretRow, error)
func (*Queries) LockKeyringState ¶
LockKeyringState reads and locks the active key for its activation by `muster secrets rotate-key`.
func (*Queries) LockRotateConnections ¶
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 ¶
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 ¶
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.