secrets

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2018 License: Apache-2.0 Imports: 10 Imported by: 9

Documentation

Overview

Package secrets implements support for retrieving user Secrets from external sources (File).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SecretLoader

type SecretLoader interface {
	// LoadSecretsByUserName should load a set of secrets for a given user
	LoadSecretsByUserName(string) map[string]string
}

SecretLoader is an interface which allows aptomi to load secrets for users from different sources (e.g. file, external store, etc)

func NewSecretLoaderFromDir

func NewSecretLoaderFromDir(baseDir string) SecretLoader

NewSecretLoaderFromDir returns new UserLoaderFromDir, given a directory where files should be read from

type SecretLoaderFromDir

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

SecretLoaderFromDir allows to load secrets for users from a given directory

func (*SecretLoaderFromDir) LoadSecretsAll

func (loader *SecretLoaderFromDir) LoadSecretsAll() map[string]map[string]string

LoadSecretsAll loads all secrets

func (*SecretLoaderFromDir) LoadSecretsByUserName

func (loader *SecretLoaderFromDir) LoadSecretsByUserName(user string) map[string]string

LoadSecretsByUserName loads secrets for a single user

type SecretLoaderMock

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

SecretLoaderMock allows to mock secret loader and use in-memory user storage

func NewSecretLoaderMock

func NewSecretLoaderMock() *SecretLoaderMock

NewSecretLoaderMock returns new SecretLoaderMock

func (*SecretLoaderMock) AddSecret

func (loader *SecretLoaderMock) AddSecret(userName string, secretName string, secretValue string)

AddSecret adds a secret for a given user

func (*SecretLoaderMock) LoadSecretsAll

func (loader *SecretLoaderMock) LoadSecretsAll() map[string]map[string]string

LoadSecretsAll loads all secrets

func (*SecretLoaderMock) LoadSecretsByUserName

func (loader *SecretLoaderMock) LoadSecretsByUserName(userName string) map[string]string

LoadSecretsByUserName loads secrets for a single user

type UserSecrets

type UserSecrets struct {
	User    string
	Secrets map[string]string
}

UserSecrets represents a single user secret (user name and a map of secrets)

Jump to

Keyboard shortcuts

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