Documentation
¶
Overview ¶
Package sqlstore provides a SQL table-backed vault implementation.
Index ¶
- Constants
- type Config
- type Provider
- func (p *Provider) Capabilities() vault.Capabilities
- func (p *Provider) Close() error
- func (p *Provider) Delete(ctx context.Context, path string) error
- func (p *Provider) Exists(ctx context.Context, path string) (bool, error)
- func (p *Provider) Get(ctx context.Context, path string) (*vault.Secret, error)
- func (p *Provider) List(ctx context.Context, prefix string) ([]string, error)
- func (p *Provider) Migrate(ctx context.Context) error
- func (p *Provider) Name() string
- func (p *Provider) Set(ctx context.Context, path string, secret *vault.Secret) error
Constants ¶
View Source
const ( // DialectMySQL uses MySQL-compatible SQL, including DoltDB. DialectMySQL = "mysql" // DialectPostgres uses PostgreSQL-compatible SQL. DialectPostgres = "postgres" // DialectSQLite uses SQLite-compatible SQL. DialectSQLite = "sqlite" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// DB is the open SQL database handle. The caller owns its lifetime.
DB *sql.DB
// Table is the table that stores encrypted secrets. Defaults to
// "omnivault_secrets".
Table string
// Dialect controls placeholder and upsert syntax. Supported values are
// "mysql", "postgres", and "sqlite". Empty defaults to "mysql".
Dialect string
// EncryptionKey is the AES key used to encrypt secret payloads. It must be
// 16, 24, or 32 bytes. Store this key outside the database, for example in
// env, keyring, or a cloud secret manager.
EncryptionKey []byte
// KeyID is optional metadata that identifies which key encrypted a row.
KeyID string
// AutoMigrate creates the table if it does not already exist.
AutoMigrate bool
// ReadOnly prevents writes and deletes.
ReadOnly bool
}
Config configures the SQL-backed vault provider.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements vault.Vault with encrypted rows in a SQL table.
func (*Provider) Capabilities ¶
func (p *Provider) Capabilities() vault.Capabilities
Capabilities returns provider capabilities.
Click to show internal directories.
Click to hide internal directories.