secreturl

package
v2.1.59 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReplaceURIs

func ReplaceURIs(s string, client Client, r *regexp.Regexp, schemePrefix string) (string, error)

ReplaceURIs will replace any URIs with the given regular expression and scheme using the secret URL client

func ToURI

func ToURI(path string, key string, scheme string) string

ToURI constructs a vault: URI for the given path and key

Types

type Client

type Client interface {
	// Read reads a named secret from the vault
	Read(secretName string) (map[string]interface{}, error)

	// ReadObject reads a generic named object from vault.
	// The secret _must_ be serializable to JSON.
	ReadObject(secretName string, secret interface{}) error

	// Write writes a named secret to the vault
	Write(secretName string, data map[string]interface{}) (map[string]interface{}, error)

	// WriteObject writes a generic named object to the vault.
	// The secret _must_ be serializable to JSON.
	WriteObject(secretName string, secret interface{}) (map[string]interface{}, error)

	// ReplaceURIs will replace any vault: URIs in a string (or whatever URL scheme the secret URL client supports
	ReplaceURIs(text string) (string, error)
}

Client is a simple interface for accessing vault-like secret storage URLs such as `vault.Client` or a file system we can use to access secret files and values in helm.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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