secrets

package
v0.0.0-...-da19eeb Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2019 License: MIT Imports: 12 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPrivateKey

func GetPrivateKey(storage SecretStorage, path string) (*rsa.PrivateKey, error)

func GetPublicKey

func GetPublicKey(storage SecretStorage, path string) (*rsa.PublicKey, error)

func LoadKeyFromBlob

func LoadKeyFromBlob(data []byte) (interface{}, error)

func LoadPrivateKey

func LoadPrivateKey(data []byte) (*rsa.PrivateKey, error)

func LoadPublicKey

func LoadPublicKey(data []byte) (*rsa.PublicKey, error)

Types

type ConsulClient

type ConsulClient = consul.Client

type LocalStorage

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

func NewLocalStorage

func NewLocalStorage(cfg *LocalStorageConfig) *LocalStorage

func (*LocalStorage) ReadStringArray

func (s *LocalStorage) ReadStringArray(path string) ([]string, error)

func (*LocalStorage) ReadStringValue

func (s *LocalStorage) ReadStringValue(path string) (string, error)

type LocalStorageConfig

type LocalStorageConfig struct {
	Values map[string]interface{} `json:"values"`
}

type SecretData

type SecretData = map[string]interface{}

type SecretStorage

type SecretStorage interface {
	ReadStringValue(path string) (string, error)
	ReadStringArray(path string) ([]string, error)
}

SecretStorage defines interface for reading from a confidential storage

func NewSecretStorage

func NewSecretStorage(cfg *StorageConfig) (SecretStorage, error)

type StorageConfig

type StorageConfig struct {
	Vault *VaultStorageConfig `json:"vault"`
	Local *LocalStorageConfig `json:"local"`
}

type VaultClient

type VaultClient = vault.Client

type VaultStorage

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

func NewVaultStorage

func NewVaultStorage(cfg *VaultStorageConfig) (*VaultStorage, error)

func (*VaultStorage) ReadSecret

func (s *VaultStorage) ReadSecret(path string) (SecretData, error)

func (*VaultStorage) ReadStringArray

func (s *VaultStorage) ReadStringArray(path string) ([]string, error)

func (*VaultStorage) ReadStringValue

func (s *VaultStorage) ReadStringValue(path string) (string, error)

type VaultStorageConfig

type VaultStorageConfig struct {
	Address string `json:"address"`
	Approle string `json:"approle"`
	Path    string `json:"path"`
}

Jump to

Keyboard shortcuts

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