Documentation
¶
Overview ¶
Package sanctum provides Go bindings for the Sanctum credential vault via CGo wrapping the sanctum-ffi C library.
Index ¶
- Variables
- type Vault
- func (v *Vault) AuditLog(agentIDFilter string) (string, error)
- func (v *Vault) CheckPolicy(name string, agentID string) error
- func (v *Vault) Close()
- func (v *Vault) Delete(name string, agentID string) error
- func (v *Vault) ListCredentials(agentID string) (string, error)
- func (v *Vault) Retrieve(name string, agentID string) ([]byte, error)
- func (v *Vault) Store(name string, secret []byte, agentID string, policyJSON string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNullPointer = errors.New("sanctum: null pointer") ErrInvalidUTF8 = errors.New("sanctum: invalid UTF-8") ErrNotInitialized = errors.New("sanctum: vault not initialized") ErrAccessDenied = errors.New("sanctum: access denied") ErrNotFound = errors.New("sanctum: credential not found") ErrCrypto = errors.New("sanctum: cryptographic error") ErrBufferTooSmall = errors.New("sanctum: buffer too small") ErrJSON = errors.New("sanctum: JSON error") ErrPanic = errors.New("sanctum: panic caught at FFI boundary") ErrUnknown = errors.New("sanctum: unknown error") )
Functions ¶
This section is empty.
Types ¶
type Vault ¶
type Vault struct {
// contains filtered or unexported fields
}
Vault wraps an opaque SanctumVault handle from the FFI layer.
func Init ¶
Init creates and initializes a new vault at the given path with the supplied passphrase.
func (*Vault) AuditLog ¶
AuditLog returns the audit log as a JSON string. If agentIDFilter is non-empty, only entries for that agent are returned.
func (*Vault) CheckPolicy ¶
CheckPolicy checks whether an agent is allowed to retrieve a credential. Returns nil if allowed, ErrAccessDenied if not.
func (*Vault) Close ¶
func (v *Vault) Close()
Close frees the underlying vault handle. Safe to call multiple times.
func (*Vault) ListCredentials ¶
ListCredentials returns credential paths as a JSON array string.
Click to show internal directories.
Click to hide internal directories.