Documentation ¶
Index ¶
Constants ¶
const (
// ErrNotFound is the error returned when secret does not exist.
ErrNotFound = "secret not found"
)
Variables ¶
This section is empty.
Functions ¶
func IsNotFound ¶
IsNotFound returns whether given error is a "Not Found" error or not.
Types ¶
type ApplyOption ¶
An ApplyOption is called before patching the current secret to match the desired secret. ApplyOptions are not called if no current object exists.
func AllowUpdateIf ¶
func AllowUpdateIf(fn func(current, desired *Secret) bool) ApplyOption
AllowUpdateIf will only update the current object if the supplied fn returns true. An error that satisfies IsNotAllowed will be returned if the supplied function returns false. Creation of a desired object that does not currently exist is always allowed.
type LogicalClient ¶
type LogicalClient interface { Read(path string) (*api.Secret, error) Write(path string, data map[string]interface{}) (*api.Secret, error) Delete(path string) (*api.Secret, error) }
LogicalClient is a client to perform logical backend operations on Vault.
type Secret ¶
type Secret struct { CustomMeta map[string]string Data map[string]string // contains filtered or unexported fields }
Secret is a Vault KV secret.
func (*Secret) AddMetadata ¶
AddMetadata adds supplied key value as metadata.
type V1Client ¶
type V1Client struct {
// contains filtered or unexported fields
}
V1Client is a Vault KV V1 Secrets Engine client. https://www.vaultproject.io/api-docs/secret/kv/kv-v1
func NewV1Client ¶
func NewV1Client(logical LogicalClient, mountPath string) *V1Client
NewV1Client returns a new V1Client.
func (*V1Client) Apply ¶
func (c *V1Client) Apply(path string, secret *Secret, ao ...ApplyOption) error
Apply applies given Secret at path by patching its Data and setting provided custom metadata.
type V2Client ¶
type V2Client struct {
// contains filtered or unexported fields
}
V2Client is a Vault KV V2 Secrets Engine client. https://www.vaultproject.io/api/secret/kv/kv-v2
func NewV2Client ¶
func NewV2Client(logical LogicalClient, mountPath string) *V2Client
NewV2Client returns a new V2Client.
func (*V2Client) Apply ¶
func (c *V2Client) Apply(path string, secret *Secret, ao ...ApplyOption) error
Apply applies given Secret at path by patching its Data and setting provided custom metadata.