Documentation
¶
Index ¶
- type CountSecretsParams
- type CreateSecretParams
- type DBTX
- type GetSecretByNameParams
- type ListSecretsParams
- type Queries
- func (q *Queries) CountSecrets(ctx context.Context, arg CountSecretsParams) (int64, error)
- func (q *Queries) CreateSecret(ctx context.Context, arg CreateSecretParams) (SecrSecret, error)
- func (q *Queries) DeleteSecret(ctx context.Context, id uuid.UUID) error
- func (q *Queries) GetSecretByID(ctx context.Context, id uuid.UUID) (SecrSecret, error)
- func (q *Queries) GetSecretByName(ctx context.Context, arg GetSecretByNameParams) (SecrSecret, error)
- func (q *Queries) ListSecrets(ctx context.Context, arg ListSecretsParams) ([]SecrSecret, error)
- func (q *Queries) RevokeSecret(ctx context.Context, id uuid.UUID) (SecrSecret, error)
- func (q *Queries) UpdateSecret(ctx context.Context, arg UpdateSecretParams) (SecrSecret, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type SecrSecret
- type UpdateSecretParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CountSecretsParams ¶
type CreateSecretParams ¶
type CreateSecretParams struct {
Name string `json:"name"`
EncryptedValue string `json:"encrypted_value"`
KeyVersion int32 `json:"key_version"`
ConnectorType string `json:"connector_type"`
Description pgtype.Text `json:"description"`
TenantID pgtype.Text `json:"tenant_id"`
CreatedBy pgtype.Text `json:"created_by"`
}
type GetSecretByNameParams ¶
type ListSecretsParams ¶
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CountSecrets ¶
func (*Queries) CreateSecret ¶
func (q *Queries) CreateSecret(ctx context.Context, arg CreateSecretParams) (SecrSecret, error)
func (*Queries) DeleteSecret ¶
func (*Queries) GetSecretByID ¶
func (*Queries) GetSecretByName ¶
func (q *Queries) GetSecretByName(ctx context.Context, arg GetSecretByNameParams) (SecrSecret, error)
tenant_id is matched with IS NOT DISTINCT FROM, so a NULL argument means "the platform-scoped row" (tenant_id IS NULL) and NOT "any tenant's row". The previous (narg IS NULL OR tenant_id = narg) form collapsed to TRUE on a NULL argument and returned an arbitrary tenant's secret — a cross-tenant credential leak, since the query has no ORDER BY.
func (*Queries) ListSecrets ¶
func (q *Queries) ListSecrets(ctx context.Context, arg ListSecretsParams) ([]SecrSecret, error)
func (*Queries) RevokeSecret ¶
func (*Queries) UpdateSecret ¶
func (q *Queries) UpdateSecret(ctx context.Context, arg UpdateSecretParams) (SecrSecret, error)
type SecrSecret ¶
type SecrSecret struct {
ID uuid.UUID `json:"id"`
Name string `json:"name"`
// AES-256-GCM ciphertext (base64). Nonce prepended. Never store plaintext.
EncryptedValue string `json:"encrypted_value"`
// Encryption key version used — enables key rotation without re-encrypting all rows
KeyVersion int32 `json:"key_version"`
ConnectorType string `json:"connector_type"`
Description pgtype.Text `json:"description"`
// active | revoked
Status string `json:"status"`
TenantID pgtype.Text `json:"tenant_id"`
CreatedBy pgtype.Text `json:"created_by"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}