secrets

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 9 Imported by: 0

README

secrets

Secrets for cli

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSecretNotFound = errors.New("Secret is not found")
)

Functions

func ReadLine added in v0.4.0

func ReadLine(hint string) (string, error)

ReadLine reads line with provided hint

func ReadPassword added in v0.4.0

func ReadPassword(hint string) (string, error)

ReadPassword reads password without echo

Types

type EncEnvStorage added in v0.2.0

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

EncryptedEnvironmentStorage stores secrets in environment variables

func NewEncEnvStorage added in v0.2.0

func NewEncEnvStorage(master, prefix string, uppercase bool) (*EncEnvStorage, error)

NewEncryptedEnvironment Storage creates new environment storage

func (*EncEnvStorage) Get added in v0.2.0

func (ees *EncEnvStorage) Get(name string) (string, error)

Get reads secret from storage

func (*EncEnvStorage) Prepare added in v0.2.0

func (ees *EncEnvStorage) Prepare(name, secret string) (string, string, error)

Prepare secret value name and encrypted value

func (*EncEnvStorage) Set added in v0.2.0

func (ees *EncEnvStorage) Set(name, secret string) error

Set the secret value

type EncMapStorage added in v0.4.0

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

EncMapStorage stores secrets in encrypted JSON with a plan string map structure

func NewEncMapStorage added in v0.4.0

func NewEncMapStorage(master, dump string) (*EncMapStorage, error)

NewEncryptedEnvironment Storage creates new environment storage

func (*EncMapStorage) Dump added in v0.4.0

func (s *EncMapStorage) Dump() (string, error)

func (*EncMapStorage) Get added in v0.4.0

func (s *EncMapStorage) Get(name string) (string, error)

Get reads secret from storage

func (*EncMapStorage) Set added in v0.4.0

func (s *EncMapStorage) Set(name, secret string)

Set the secret value

type EnvStorage added in v0.2.0

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

EnvStorage stores secrets in environment variables

func NewEnvStorage added in v0.2.0

func NewEnvStorage(prefix string, uppercase bool) *EnvStorage

NewMemoryStorage creates new environment storage

func (*EnvStorage) Get added in v0.2.0

func (es *EnvStorage) Get(name string) (string, error)

Get reads secret from storage

func (*EnvStorage) Set added in v0.2.0

func (es *EnvStorage) Set(name, secret string) error

Set sets the secret value in memory storage

type MemoryStorage

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

MemoryStorage does not persist secrets data

func NewMemoryStorage added in v0.2.0

func NewMemoryStorage() *MemoryStorage

NewMemoryStorage creates new memory storage

func (*MemoryStorage) Get

func (ms *MemoryStorage) Get(name string) (string, error)

Get reads secret from storage

func (*MemoryStorage) Set

func (ms *MemoryStorage) Set(name, secret string)

Set sets the secret value in memory storage

type Storage

type Storage interface {
	Get(name string) (string, error)
}

Storage provides the interface for reading secrets

Directories

Path Synopsis
cmd
internal
bech32
Package bech32 is a modified version of the reference implementation of BIP173.
Package bech32 is a modified version of the reference implementation of BIP173.

Jump to

Keyboard shortcuts

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