agent

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

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

Agent struct represnts the init continer

func New

func New(config *Config, logger hclog.Logger) (*Agent, error)

New returns new Agent with writeSecretToMountPath

func (*Agent) Process added in v0.7.0

func (a *Agent) Process(ctx context.Context) error

Process will get secrets and save them in specified location

type Config

type Config struct {
	Secrets        []*Secret        `json:"secret"`
	ProviderName   string           `json:"provider_name"`
	ProviderConfig *provider.Config `json:"provider_config"`
}

Config is the top level struct that composes am Agent configuration file.

func (*Config) Render

func (c *Config) Render() ([]byte, error)

Render is a method used for converting config to json

type MountPathWriter

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

MountPathWriter is a main writer

func NewMountPathWriter

func NewMountPathWriter(logger hclog.Logger) *MountPathWriter

NewMountPathWriter is a factory for MountPathWriter

func (*MountPathWriter) WriteSecret

func (w *MountPathWriter) WriteSecret(secret *Secret) error

WriteSecret is a main method for making a secret available to the other container

type Pipeline added in v0.7.0

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

Pipeline ...

func NewPipeline added in v0.7.0

func NewPipeline(writer SecretsWriter, provider Provider, logger hclog.Logger, workersNumber int) *Pipeline

NewPipeline ...

func (*Pipeline) Do added in v0.7.0

func (p *Pipeline) Do(ctx context.Context, secrets []*Secret) error

Do ...

type Provider added in v0.7.0

type Provider interface {
	GetSecret(ctx context.Context, secretURL string) (string, error)
}

Provider is an interfce that needs to be implemented by providers

type Secret added in v0.7.0

type Secret struct {
	// Name of the secret used as the filename for the rendered secret file.
	Name string `json:"name"`

	// URL of the secret e.g. keyvault://name/key
	URL string `json:"url"`

	// Mount Path
	MountPath string `json:"mount_path"`

	Value string `json:"value"`
}

Secret is a metadata object sued for fetching and storing secret

type SecretsWriter

type SecretsWriter interface {
	WriteSecret(secret *Secret) error
}

SecretsWriter is an interface for writing secrets

Directories

Path Synopsis
provider
aws

Jump to

Keyboard shortcuts

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