plugins

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// PluginInterface for secrets. This first part of the
	// three-part plugin key is only seen/used by the plugins when the host is
	// communicating with the plugin and is not exposed to users.
	PluginInterface = "secrets"

	// PluginProtocolVersion is the currently supported plugin protocol version for secrets.
	PluginProtocolVersion = 2
)

Variables

View Source
var (
	// ErrNotImplemented is the error to be returned if a method is not implemented
	// in a secret plugin
	ErrNotImplemented = errors.New("not implemented")
)

Functions

This section is empty.

Types

type SecretsProtocol

type SecretsProtocol interface {
	// Resolve a secret value from a secret store
	// - keyName is name of the key where the secret can be found.
	// - keyValue is the value of the key.
	// if keyName can not be reolved by a plugin implementation, the plugin will
	// fall back to use the host plugin.
	// Examples:
	// - keyName=env, keyValue=CONN_STRING
	// - keyName=key, keyValue=conn-string
	// - keyName=path, keyValue=/tmp/connstring.txt
	Resolve(ctx context.Context, keyName string, keyValue string) (string, error)

	// Create stores a secret value in a secret store.
	// - keyName is name of the key where the secret can be found.
	// - keyValue is the value of the key.
	// Examples:
	// - keyName=env, keyValue=CONN_STRING, value=redis://foo
	// - keyName=key, keyValue=conn-string, value=redis://foo
	// - keyName=path, keyValue=/tmp/connstring.txt, value=redis://foo
	Create(ctx context.Context, keyName string, keyValue string, value string) error
}

SecretsProtocol is the interface that secrets plugins must implement. This defines the protocol used to communicate with secrets plugins.

Directories

Path Synopsis
Package filesystem provides a plugin implementing the secret plugin protocol for creating/resolving secrets from the local filesystem.
Package filesystem provides a plugin implementing the secret plugin protocol for creating/resolving secrets from the local filesystem.
Package host provides a plugin implementing the original behavior of resolving secrets from the local host: environment variables, paths, commands and static values.
Package host provides a plugin implementing the original behavior of resolving secrets from the local host: environment variables, paths, commands and static values.
Package inmemory provides an in-memory implementation of a secret store suitable for unit testing.
Package inmemory provides an in-memory implementation of a secret store suitable for unit testing.
Package proto is the protobuf definition for the SecretsProtocol
Package proto is the protobuf definition for the SecretsProtocol

Jump to

Keyboard shortcuts

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