vault

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CheckCreate = 1 << iota
	CheckDelete
	CheckList
	CheckRead
	CheckUpdate

	CheckAll                      = CheckCreate | CheckDelete | CheckList | CheckRead | CheckUpdate
	CheckOrigin                   = CheckRead | CheckList
	CheckDestination              = CheckCreate | CheckDelete | CheckList | CheckRead | CheckUpdate
	CheckDestinationWithoutDelete = CheckCreate | CheckList | CheckRead | CheckUpdate
)

Variables

View Source
var (
	ErrInitialize      = fmt.Errorf("cannot initialize vault client")
	ErrInvalidToken    = fmt.Errorf("check token permission")
	ErrConnection      = fmt.Errorf("vault connection refused")
	ErrInvalidPath     = fmt.Errorf("invalid path")
	ErrCastPathData    = fmt.Errorf("type cast errors on data from path")
	ErrInvalidSecretId = fmt.Errorf("invalid secret id")
	ErrInvalidRoleId   = fmt.Errorf("invalid role id")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	*api.Client
	Address string
	Mode    string
}

func NewClient

func NewClient(address string, token string, approlePath string, roleID string, secretID string) (*Client, error)

func (*Client) CheckTokenPermissions

func (v *Client) CheckTokenPermissions(p string, checks int) error

func (*Client) DeepListPaths

func (v *Client) DeepListPaths(path string) ([]string, []string, error)

DeepListPaths returns set of paths and folders path is a single path which has key value pairs folder is a parent set of individual paths, it can have more folders and paths

func (*Client) GetAllPaths

func (v *Client) GetAllPaths(metaPaths []string) ([]string, []error)

GetAllSecretPaths recursively lists all absolute paths given a root vault kv v2 path Note: do not convert this into go routines as we dont know how to kill the goroutine

func (*Client) GetMount

func (v *Client) GetMount(m string) (*api.MountOutput, error)

func (*Client) MountChecks added in v0.1.0

func (v *Client) MountChecks(mPath string, checks int, name string) error

func (*Client) TokenRenewer

func (v *Client) TokenRenewer(ctx context.Context, errCh chan error)

renews origin token

Jump to

Keyboard shortcuts

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