vault

package
v0.0.0-...-9491308 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2020 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package vault interfaces with the vault.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotLoggedIn = errors.New("vault client is not logged in")

ErrNotLoggedIn means that the vault client has no token to operate with.

Functions

func AppRoleLogin

func AppRoleLogin(role, secret string) func(*Client) error

AppRoleLogin logs in with the given app role.

func TokenLogin

func TokenLogin(token string) func(*Client) error

TokenLogin just uses the given token for authentication with vault.

Types

type Client

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

Client for vault operations.

func New

func New(h rest.Client, host string, login func(*Client) error) *Client

New creates a new vault client.

func (*Client) AutoRenew

func (c *Client) AutoRenew(ctx context.Context) <-chan error

AutoRenew automatically renews certificates.

func (*Client) CreateSubToken

func (c *Client) CreateSubToken(policy string) (string, error)

CreateSubToken from the current token with the given policy only.

func (*Client) GetSecret

func (c *Client) GetSecret(backend, path string, destination interface{}) error

GetSecret reads a secret into an interface.

func (*Client) Login

func (c *Client) Login() error

Login once.

func (*Client) RESTClient

func (c *Client) RESTClient(name, pki string) (rest.Client, error)

RESTClient creates a new REST client for mauzr.

func (*Client) RESTServer

func (c *Client) RESTServer(ctx context.Context, handler http.Handler, name string, pkis ...string) <-chan error

RESTServer starts a new REST server in the mauzr context.

func (*Client) UpdateSecret

func (c *Client) UpdateSecret(backend, path string, source interface{}) error

UpdateSecret reads a secret from an interface into vault.

Jump to

Keyboard shortcuts

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