vault

package module
v0.0.0-...-9cd92a7 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2021 License: MIT Imports: 8 Imported by: 0

README

vault

Documentation License Build Status Coverage Go Report Card

A package that facilitates working with http://vaultproject.io/ in context of CLI. It increases the security of Golang applications by populating a command line arguments from the vault.

Installation

Make sure you have a working Go environment. Go version 1.2+ is supported.

See the install instructions for Go.

To install vault, simply run:

$ go get github.com/phogolabs/vault

Contributing

We are open for any contributions. Just fork the project.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client of the vault

func NewClient

func NewClient(config *api.Config) (*Client, error)

NewClient creates a new client

func (*Client) Auth

func (c *Client) Auth(method string, config map[string]interface{}) error

Auth authenticates the client

func (*Client) Mount

func (c *Client) Mount(path string) (*api.MountOutput, error)

Mount return the mount for given path

func (*Client) Secret

func (c *Client) Secret(path string) (map[string]interface{}, error)

Secret returns a secrete

func (*Client) SetToken

func (c *Client) SetToken(token string)

SetToken sets the token

func (*Client) Stop

func (c *Client) Stop()

Stop stops renewing

type Provider

type Provider struct {
	Repository Repository
}

Provider is a parser that populates flags from Hashi Corp Vault

func (*Provider) Provide

func (m *Provider) Provide(ctx *cli.Context) (err error)

Provide parses the args

func (*Provider) Rollback

func (m *Provider) Rollback(ctx *cli.Context) error

Rollback stops the provider

type Repository

type Repository interface {
	// Secret provides the secret from the backend
	Secret(path string) (map[string]interface{}, error)
	// Stop stops the repository
	Stop()
}

Repository is a repository of the secrets

type RepositoryTree

type RepositoryTree struct {
	Repository Repository
	Root       map[string]map[string]interface{}
}

RepositoryTree caches the secrets

func (*RepositoryTree) Secret

func (r *RepositoryTree) Secret(path string) (map[string]interface{}, error)

Secret returns value from a tree

func (*RepositoryTree) Stop

func (r *RepositoryTree) Stop()

Stop stops the tree

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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