localpath

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NameLocalPath is the name of the handler
	NameLocalPath = "LocalPath"
	// VaultTokenPath is the default token path where we will store the data regarding the vault tokens
	VaultTokenPath = "%s/.vault-tokens"
)

Variables

This section is empty.

Functions

func New

func New() handler.Handler

New create a new vault token handler with the default vault path specified as VaultTokenPath

func NewWithPath

func NewWithPath(path string) handler.Handler

NewWithPath create a new vault token handler with a specified vault path

Types

type LocalPath

type LocalPath struct {
	TokenDirectory string
}

LocalPath is a vault token handler implementing handler.Handler, this handler is used to handle vault tokens based on the vault address.

func (LocalPath) Decode added in v0.1.3

func (l LocalPath) Decode(path string) (data handler.Data, err error)

Decode the data that has been encoded by this handler

func (LocalPath) Description

func (l LocalPath) Description() string

Description return the description of the handler

func (LocalPath) Encode added in v0.1.3

func (l LocalPath) Encode(data handler.Data) ([]byte, error)

Encode the data that represents the data

func (LocalPath) Erase

func (l LocalPath) Erase(vaultAddr *url.URL) (err error)

Erase removes a token associated with the vaultAddr, and returns error if it fails to erase the vault token in the handler, otherwise nil

func (LocalPath) Get

func (l LocalPath) Get(vaultAddr *url.URL) (token string, err error)

Get retrieves a token associated with the vaultAddr from LocalPath.TokenDirectory, returns an error if there is an issue with creating, reading the data from the directory

func (LocalPath) List added in v0.1.3

func (l LocalPath) List() (items []handler.Data, err error)

List the available tokens currently stored if supported by the handler

func (LocalPath) Name

func (l LocalPath) Name() string

Name return the name of the handler

func (LocalPath) Path

func (l LocalPath) Path() string

Path is the directory where the data is stored for the vault tokens

func (LocalPath) Purge added in v0.1.3

func (l LocalPath) Purge(dryRun bool) (items []handler.Data, err error)

Purge all the tokens we currently have stored if supported by the handler, and returns all the deleted tokens

func (LocalPath) Store

func (l LocalPath) Store(token string, vaultAddr *url.URL) (err error)

Store a token associated with the vaultAddr, and returns error if it fails to store the vault token in the handler, otherwise nil

Jump to

Keyboard shortcuts

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