vaultengine

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendStringToFile

func AppendStringToFile(path, text string) error

*

  • Append string to the end of file *
  • path: the path of the file
  • text: the string to be appended. If you want to append text line to file,
  • put a newline '\n' at the of the string.

func CleanupPath

func CleanupPath(path string) string

CleanupPath cleans up unwanted characters so that the path looks nice and clean

func ConvertToJSON

func ConvertToJSON(folder []Folder) ([]byte, error)

ConvertToJSON will return the Folder object as yaml

func ConvertToYaml

func ConvertToYaml(folder []Folder) ([]byte, error)

ConvertToYaml will return the Folder object as yaml

func EnsureFolder

func EnsureFolder(p string) string

EnsureFolder ensures a path is a folder (adds a trailing "/").

func IsFolder

func IsFolder(p string) bool

IsFolder returns true if the path is a folder Folders are suffixed with "/" in Vault

func PathJoin

func PathJoin(p ...string) string

PathJoin combines multiple paths into one.

func PathSplitPrefix

func PathSplitPrefix(path string) (string, string)

PathSplitPrefix will split the first part of a string into it's own variable and return it together with the rest of the path

func WriteToFile

func WriteToFile(file string, data []byte) error

WriteToFile will create a file and store the provieded data in it

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client describes the arguments that is needed to to establish a connecting to a Vault instance

func NewClient

func NewClient(addr, token string, insecure bool, namespace string) *Client

NewClient creates a instance of the VaultClient struct

func (*Client) CollectPaths

func (client *Client) CollectPaths(path string) ([]string, error)

CollectPaths will retrieve all paths to secrets defined under the given path

func (*Client) FolderExport

func (client *Client) FolderExport(path string) (Folder, error)

FolderExport will export all subfolders and secrets from a specified location

func (*Client) FolderRead

func (client *Client) FolderRead(path string) ([]interface{}, error)

FolderRead reads the subpaths and secrets of the provided path

func (*Client) GetMounts

func (client *Client) GetMounts() map[string]string

Get list of all engines mounted

func (*Client) MountpathSplitPrefix

func (client *Client) MountpathSplitPrefix(path string) (string, string, error)

func (*Client) PathReader

func (client *Client) PathReader(parentFolder *Folder, path string) error

PathReader recursively reads the provided path and all subpaths

func (*Client) SecretDelete

func (client *Client) SecretDelete(path string) (*api.Secret, error)

SecretDelete deletet a Vault secret by given path

func (*Client) SecretRead

func (client *Client) SecretRead(path string) map[string]interface{}

SecretRead is used for reading a secret from a Vault instance

func (*Client) SecretWrite

func (client *Client) SecretWrite(path string, data map[string]interface{})

SecretWrite is used for writing data to a Vault instance

func (*Client) SetEngineType

func (client *Client) SetEngineType(engineType string)

SetEngineType defines which vault secret engine type that is being used

func (*Client) UseEngine

func (client *Client) UseEngine(engine string)

UseEngine defines which engine the Vault client will use

type Folder

type Folder map[string]interface{}

Folder defines a level of the Vault structure

Jump to

Keyboard shortcuts

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