store

package
v1.39.13 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

could do conditional linux build, but no actual hard linux dependencies

Index

Constants

View Source
const (
	Unset     = ""
	None      = "none"
	PassLinux = "pass_linux"
	WinCred   = "wincred"
	File      = "file"
)

Supported store types.

Variables

This section is empty.

Functions

func GetDefaultPath

func GetDefaultPath() (string, error)

GetDefaultPath retrieves an OS-independent default path for secrets, tokens, encrypted key files. By default, it is /home/{username}/.thy/.

func GetSecureSetting

func GetSecureSetting(key string) (string, *errors.ApiError)

func ReadFileInDefaultPath

func ReadFileInDefaultPath(fileName string) (string, error)

ReadFileInDefaultPath attempts to read a file in a store path. If the store path is not found, then the default thy directory is searched for a given file.

func StoreSecureSetting

func StoreSecureSetting(key string, val string, sType string) *errors.ApiError

func ValidateCredentialStore

func ValidateCredentialStore(st string) *errors.ApiError

Types

type NoneStore

type NoneStore struct{}

func (*NoneStore) Delete

func (s *NoneStore) Delete(key string) *errors.ApiError

func (*NoneStore) Get

func (s *NoneStore) Get(key string, outSecret interface{}) *errors.ApiError

func (*NoneStore) List

func (s *NoneStore) List(prefix string) ([]string, *errors.ApiError)

func (*NoneStore) Store

func (s *NoneStore) Store(key string, secret interface{}) *errors.ApiError

func (*NoneStore) StoreString

func (s *NoneStore) StoreString(key string, data string) *errors.ApiError

func (*NoneStore) Wipe

func (s *NoneStore) Wipe(prefix string) *errors.ApiError

type Store

type Store interface {
	Store(key string, secret interface{}) *errors.ApiError
	StoreString(key string, data string) *errors.ApiError
	Get(key string, outSecret interface{}) *errors.ApiError
	Delete(key string) *errors.ApiError
	Wipe(prefix string) *errors.ApiError
	List(prefix string) ([]string, *errors.ApiError)
}

Store interface provides common methods for storing data.

func GetStore

func GetStore(st string) (Store, *errors.ApiError)

func NewFileStore

func NewFileStore(basePath string) Store

func NewPassStore

func NewPassStore() Store

func NewSecureStore

func NewSecureStore(internalStore ch.StoreHelper) Store

func NewWinStore

func NewWinStore() Store

Directories

Path Synopsis
A `pass` based credential helper.
A `pass` based credential helper.

Jump to

Keyboard shortcuts

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