Back to

Package secreturl

Latest Go to latest

The latest major version is v2.

Published: Jun 25, 2020 | License: Apache-2.0 | Module:


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

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 acessing vault-like secret storage URLs such as `vault.Client` or a file system we can use to access secret files and values in helm. go:generate pegomock generate Client -o mocks/secreturl_client.go

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier