Documentation
¶
Overview ¶
Package vault defines a KMS-agnostic interface for storing the private key material Hilt manages (tenant keys, bucket keys, S3 access keys). Keys are opaque string paths and values are raw private-key bytes. Implementations may be backed by any KMS; an in-memory implementation lives in vault/memory.
Index ¶
Constants ¶
View Source
const KeyNotFoundErrorName = "KeyNotFound"
KeyNotFoundErrorName is the name given to an error where the key is not found in the vault.
Variables ¶
View Source
var ErrNotFound = errors.New(KeyNotFoundErrorName, "key not found")
ErrNotFound is returned when no value exists for a key.
Functions ¶
func AccessKeyPath ¶
AccessKeyPath is the vault key under which an access key's private key is stored, scoped beneath its tenant.
func TenantKeyPath ¶
TenantKeyPath is the vault key under which a tenant's private key is stored.
Types ¶
type Vault ¶
type Vault interface {
// Read returns the value stored at key. It returns [ErrNotFound] if no value
// exists for the key.
Read(ctx context.Context, key string) ([]byte, error)
// Write stores value at key, overwriting any existing value.
Write(ctx context.Context, key string, value []byte) error
// Delete removes the value at key. It is idempotent: deleting an absent key
// returns nil.
Delete(ctx context.Context, key string) error
}
Vault stores secret key material by opaque string key.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package hashicorp provides a HashiCorp Vault (KV v2) backed implementation of vault.Vault, using github.com/hashicorp/vault-client-go.
|
Package hashicorp provides a HashiCorp Vault (KV v2) backed implementation of vault.Vault, using github.com/hashicorp/vault-client-go. |
|
Package memory provides an in-memory implementation of vault.Vault.
|
Package memory provides an in-memory implementation of vault.Vault. |
Click to show internal directories.
Click to hide internal directories.