secrets

package
v1.0.0-alpha.7 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: Apache-2.0 Imports: 8 Imported by: 3

Documentation

Overview

Package secrets provides primitives for resolving secrets from external sources, such as Hashicorp Vault or Azure Key Vault, into Credential Sets and injecting them into bundle runtimes.

Index

Constants

View Source
const PluginInterface = "secrets"

PluginInterface for the 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.

View Source
const SourceSecret = "secret"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func (*Client) Resolve

func (g *Client) Resolve(keyName string, keyValue string) (string, error)

type Plugin

type Plugin struct {
	Impl plugins.SecretsProtocol
}

Plugin is a generic type of plugin for working with any implementation of a secret store.

func (Plugin) Client

func (Plugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

func (*Plugin) Server

func (p *Plugin) Server(*plugin.MuxBroker) (interface{}, error)

type Server

type Server struct {
	Impl plugins.SecretsProtocol
}

func (*Server) Resolve

func (s *Server) Resolve(args map[string]interface{}, resp *string) error

type Set added in v1.0.1

type Set map[string]string

Set is an actual set of resolved values. This is the output of resolving a parameter or credential set file.

func (Set) IsValid added in v1.0.1

func (s Set) IsValid(key string) bool

IsValid determines if the provided key (designating a name of a parameter or credential) is included in the provided set

func (Set) Merge added in v1.0.1

func (s Set) Merge(s2 Set) error

Merge merges a second Set into the base.

Duplicate names are not allow and will result in an error, this is the case even if the values are identical.

func (Set) ToCNAB added in v1.0.1

func (s Set) ToCNAB() valuesource.Set

ToCNAB converts this to a type accepted by the cnab-go runtime.

type Source added in v1.0.1

type Source struct {
	Key   string
	Value string
}

Source represents a strategy for loading a value from local host.

func (Source) MarshalJSON added in v1.0.1

func (s Source) MarshalJSON() ([]byte, error)

func (Source) MarshalRaw added in v1.0.1

func (s Source) MarshalRaw() interface{}

func (Source) MarshalYAML added in v1.0.1

func (s Source) MarshalYAML() (interface{}, error)

func (*Source) UnmarshalJSON added in v1.0.1

func (s *Source) UnmarshalJSON(data []byte) error

func (*Source) UnmarshalRaw added in v1.0.1

func (s *Source) UnmarshalRaw(raw map[string]interface{}) error

func (*Source) UnmarshalYAML added in v1.0.1

func (s *Source) UnmarshalYAML(value *yaml.Node) error

type Store added in v1.0.1

type Store interface {
	plugins.SecretsPlugin
}

Store is the interface that Porter uses to interact with secrets.

type Strategy added in v1.0.1

type Strategy struct {
	// Name is the name of the parameter or credential.
	Name string `json:"name" yaml:"name"`
	// Source is the location of the value.
	// During resolution, the source will be loaded, and the result temporarily placed
	// into Value.
	Source Source `json:"source,omitempty" yaml:"source,omitempty"`
	// Value holds the parameter or credential value.
	// When a parameter or credential is loaded, it is loaded into this field. In all
	// other cases, it is empty. This field is omitted during serialization.
	Value string `json:"-" yaml:"-"`
}

Strategy represents a strategy for determining the value of a parameter or credential

Directories

Path Synopsis
host
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.
in-memory
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 pluginstore is an internal Porter package that implements the plugins.SecretsPlugin interface.
Package pluginstore is an internal Porter package that implements the plugins.SecretsPlugin interface.

Jump to

Keyboard shortcuts

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