Documentation ¶
Index ¶
Constants ¶
const (
// PayloadVersion represents the version of the SB API
PayloadVersion = "1.0"
)
Variables ¶
This section is empty.
Functions ¶
func Retriable ¶ added in v0.6.0
Retriable can be used to evaluate whether an error should be retried
func SetSecretBackendArgs ¶ added in v0.5.0
func SetSecretBackendArgs(args []string)
SetSecretBackendArgs set the secretBackendArgs var
func SetSecretBackendCommand ¶ added in v0.4.0
func SetSecretBackendCommand(command string)
SetSecretBackendCommand set the secretBackendCommand var
Types ¶
type Decryptor ¶
Decryptor is used to decrypt encrypted secrets Decryptor is implemented by SecretBackend
type DecryptorError ¶ added in v0.6.0
type DecryptorError struct {
// contains filtered or unexported fields
}
DecryptorError describes the error returned by a Decryptor
func NewDecryptorError ¶ added in v0.6.0
func NewDecryptorError(err error, retriable bool) *DecryptorError
NewDecryptorError returns a new DecryptorError
func (*DecryptorError) Error ¶ added in v0.6.0
func (e *DecryptorError) Error() string
Error implements the Error interface
func (*DecryptorError) IsRetriable ¶ added in v0.6.0
func (e *DecryptorError) IsRetriable() bool
IsRetriable returns wether the error is retriable
func (*DecryptorError) Unwrap ¶ added in v0.6.0
func (e *DecryptorError) Unwrap() error
Unwrap implements the Error interface
type DummyDecryptor ¶ added in v0.6.0
DummyDecryptor can be used in other packages to mock the secret backend
func NewDummyDecryptor ¶ added in v0.6.0
func NewDummyDecryptor(maxRetries int) *DummyDecryptor
NewDummyDecryptor returns a dummy decryptor for tests maxRetries is the number of retries before returning a nil error If maxRetries < 0 Decrypt directly returns a permanent error If maxRetries == 0 Decrypt directly returns a a nil error If maxRetries > 0 Decrypt returns a retriable error until it's called maxRetries-times then returns a nil error
type Secret ¶ added in v0.5.0
type Secret struct { Value string `json:"value,omitempty"` ErrorMsg string `json:"error,omitempty"` }
Secret defines the structure for secrets in JSON output
type SecretBackend ¶
type SecretBackend struct {
// contains filtered or unexported fields
}
SecretBackend retrieves secrets from secret backend binary SecretBackend implements the Decryptor interface
func NewSecretBackend ¶
func NewSecretBackend() *SecretBackend
NewSecretBackend returns a new SecretBackend instance