secrets

package
v0.0.0-...-f01516d Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2016 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package secrets handles the production of and access to collections of secrets. i.e. files containing sensitive data such as passwords.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSingleFile

func NewSingleFile(v *api.Volume, n string, r io.Reader, t api.SecretType) api.Secrets

NewSingleFile returns a set of Secrets containing only a single file, the provided io.Reader.

func NewTarGz

func NewTarGz(v *api.Volume, r io.ReadCloser, tgzo ...TarGzOption) (api.Secrets, error)

NewTarGz creates an api.Secrets backed by the supplied io.ReadCloser, which is expected to be a gzipped tarball of secret files.

func OpenTarGz

func OpenTarGz(v *api.Volume, fs afero.Fs, file string, tgzo ...TarGzOption) (api.Secrets, error)

OpenTarGz creates an api.Secrets backed by the supplied file, which is expected to be a gzipped tarball of secret files.

func WriteJSON

func WriteJSON(s api.Secrets, w io.Writer) error

WriteJSON merges a set of Secrets into a single map, then encodes that map as JSON to the supplied io.Writer. If duplicate secret keys are found across the files contained by Secrets the value of the first key will take precedence.

Types

type Producer

type Producer interface {
	// For returns the appropriate secrets files for the supplied api.Volume.
	For(*api.Volume) (api.Secrets, error)
}

A Producer produces secrets files for the supplied api.Volume.

func NewTalosProducer

func NewTalosProducer(lb lb.LoadBalancer, spo ...TalosProducerOption) (Producer, error)

NewTalosProducer builds a Producer backed by https://github.com/spotify/talos The supplied lb.LoadBalancer should return the address of a Talos HTTP backend.

type Producers

type Producers map[api.SecretSource]Producer

Producers maps api.SecretSources to the Producer that handles them.

type TalosProducerOption

type TalosProducerOption func(sp *talosProducer) error

A TalosProducerOption represents an argument to NewTalosProducer.

func WithContext

func WithContext(ctx context.Context) TalosProducerOption

WithContext provides an alternative parent context.Context() for HTTP requests to Talos. context.Background() is used by default.

type TarGzOption

type TarGzOption func(*tarGz) error

A TarGzOption represents an argument to NewTarGz.

func TarGzSecretType

func TarGzSecretType(s api.SecretType) TarGzOption

TarGzSecretType defines the type of the secret files within Secrets.

Jump to

Keyboard shortcuts

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