gopass

package
v1.15.14 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2024 License: MIT Imports: 2 Imported by: 16

Documentation

Overview

Package gopass contains the public gopass API.

WARNING: This package is incomplete and unstable. DO NOT USE!

Feel free to report feedback on API design and missing features but please note that bug reports will be silently ignored and the API WILL CHANGE WITHOUT NOTICE until this note is gone.

If you want to try it anyway please look at the following examples: * https://github.com/gopasspw/gopass-hibp * https://github.com/gopasspw/gopass-jsonapi * https://github.com/gopasspw/git-credential-gopass * https://github.com/gopasspw/gopass-summon-provider

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Byter

type Byter interface {
	Bytes() []byte
}

Byter is a minimal secrets write interface.

type Secret

type Secret interface {
	Byter

	Keys() []string
	// Get returns a single value for that key, use Password() to get the password value.
	Get(key string) (string, bool)
	// Values returns all values for  that key, use Password() to get the password value.
	Values(key string) ([]string, bool)
	// Set sets a single header value, use SetPassword() to set the password value.
	Set(key string, value any) error
	// Add appends the value to that key, use SetPassword() to set the password value.
	Add(key string, value any) error
	// Del removes a single header value
	Del(key string) bool

	// GetBody returns everything except the header. Use Bytes to get everything.
	Body() string
	Password() string
	SetPassword(string)
}

Secret is a secret type.

type Store

type Store interface {
	fmt.Stringer

	// List all secrets.
	List(context.Context) ([]string, error)
	// Get an decrypted secret. Revision defaults to "latest".
	Get(ctx context.Context, name, revision string) (Secret, error)
	// Set (add) a new revision of an secret
	Set(ctx context.Context, name string, sec Byter) error
	// Revisions return a list of revisions for a secret.
	Revisions(ctx context.Context, name string) ([]string, error)
	// Remove a single secret.
	Remove(ctx context.Context, name string) error
	// RemoveAll secrets with a common prefix.
	RemoveAll(ctx context.Context, prefix string) error
	// Rename a path (secret of prefix) without decrypting.
	Rename(ctx context.Context, src, dest string) error
	// Sync with a remote (if configured)
	// NOTE: We will always auto-sync when mutating the store. Use this to
	// manually pull in changes.
	Sync(ctx context.Context) error
	// Clean up any resources. MUST be called before the process exists.
	Close(ctx context.Context) error
}

Store is a secret store.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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