secretsyncer

package
v0.0.0-...-eb6870d Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BytesSource

type BytesSource struct {
	Bytes []byte
}

yaml shared:

name1: simple_secret
name2: {complex: multi, field: secret}

main/secret1: value main/pipeline/secret2: {foo: bar, baz: qux} main/pipeline/secret2: {foo: bar, baz: {deeper: nesting}}

func (BytesSource) Read

func (bs BytesSource) Read() (Data, error)

type CompoundValue

type CompoundValue map[string]interface{}

type Credential

type Credential struct {
	Location interface{}
	Value    interface{}
}

type Data

type Data = []Credential

a sample of what a secret store contains:

[]Credential{
	{
		Location: TeamPath{team:"main", secret:"secret1"},
		Value:    SimpleValue("value"),
	},
	{
		Location: PipelinePath{team:"main",pipeline:"pipeline",secret:"secret2"},
		Value:    CompoundValue{"foo":"bar","baz":"qux"},
	}
}

type DefaultVaultClient

type DefaultVaultClient struct {
	*vaultapi.Client
}

func (DefaultVaultClient) Delete

func (dvc DefaultVaultClient) Delete(path string) error

func (DefaultVaultClient) List

func (dvc DefaultVaultClient) List(path string) ([]string, error)

func (DefaultVaultClient) Write

func (dvc DefaultVaultClient) Write(path string, data map[string]interface{}) error

type PipelinePath

type PipelinePath struct {
	Team     string
	Pipeline string
	Secret   string
}

type SharedPath

type SharedPath struct {
	Secret string
}

type SimpleValue

type SimpleValue string

type Sink

type Sink interface {
	WriteSimple(string, SimpleValue) error
	WriteCompound(string, CompoundValue) error
	Clear() error
	// TODO determining path templates is a slightly different
	// responsibility than writing secrets. split out a different interface.
	PipelinePath(PipelinePath) string
	TeamPath(TeamPath) string
	SharedPath(SharedPath) string
}

type Source

type Source interface {
	Read() (Data, error)
}

type Syncer

type Syncer struct {
	Source Source
	Sink   Sink
}

func FileSyncer

func FileSyncer(secretsFile string) (Syncer, error)

func (Syncer) Sync

func (s Syncer) Sync() error

type TeamPath

type TeamPath struct {
	Team   string
	Secret string
}

type VaultClient

type VaultClient interface {
	Write(string, map[string]interface{}) error
	List(string) ([]string, error)
	Delete(string) error
}

type VaultSink

type VaultSink struct {
	Client VaultClient
}

func (*VaultSink) Clear

func (vs *VaultSink) Clear() error

func (*VaultSink) PipelinePath

func (vs *VaultSink) PipelinePath(pp PipelinePath) string

TODO these templates depend on the patterns concourse is expecting

func (*VaultSink) SharedPath

func (vs *VaultSink) SharedPath(sp SharedPath) string

func (*VaultSink) TeamPath

func (vs *VaultSink) TeamPath(tp TeamPath) string

func (*VaultSink) WriteCompound

func (vs *VaultSink) WriteCompound(path string, val CompoundValue) error

func (*VaultSink) WriteSimple

func (vs *VaultSink) WriteSimple(path string, val SimpleValue) error

Jump to

Keyboard shortcuts

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