vault

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0, MIT Imports: 3 Imported by: 0

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

func AccessKeyPath(tenantID, accessKeyID did.DID) string

AccessKeyPath is the vault key under which an access key's private key is stored, scoped beneath its tenant.

func TenantKeyPath

func TenantKeyPath(tenantID did.DID) string

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.

Jump to

Keyboard shortcuts

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