backend

package
v0.0.0-...-e3103f9 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2018 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSecretToKV

func AddSecretToKV(s core.Secret, kv map[string]interface{})

AddSecretToKV ...

Types

type Client

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

Client for communicating with vault backends

func (*Client) Delete

func (vc *Client) Delete(path string) (*vaultapi.Secret, error)

Delete secret from a vault backend

func (*Client) GetToken

func (vc *Client) GetToken() string

GetToken returns the current authentication token being used

func (*Client) List

func (vc *Client) List(path string) (*vaultapi.Secret, error)

List secrets from a vault backend

func (*Client) Read

func (vc *Client) Read(path string) (*vaultapi.Secret, error)

Read a secret from a vault backend

func (*Client) SetToken

func (vc *Client) SetToken(token string)

SetToken sets the token for authentication with a vault backend

func (*Client) TokenIsValid

func (vc *Client) TokenIsValid() bool

TokenIsValid queries the vault server to verify that the token is valid

func (*Client) UserpassLogin

func (vc *Client) UserpassLogin(username string, password string) error

UserpassLogin performs a username+password login with vault

func (*Client) Write

func (vc *Client) Write(path string, data map[string]interface{}) (*vaultapi.Secret, error)

Write secrets to a vault backend

type EJSONEndpoint

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

func NewEJSONEndpoint

func NewEJSONEndpoint() *EJSONEndpoint

NewEJSONEndpoint ...

func (*EJSONEndpoint) Marshal

func (j *EJSONEndpoint) Marshal(out io.Writer) error

Marshal ...

func (*EJSONEndpoint) Visit

func (j *EJSONEndpoint) Visit(s core.Secret)

Visit ...

type JSONEndpoint

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

JSONEndpoint ...

func NewJSONEndpoint

func NewJSONEndpoint() *JSONEndpoint

NewJSONEndpoint ...

func (*JSONEndpoint) Marshal

func (j *JSONEndpoint) Marshal(out io.Writer) error

Marshal ...

func (*JSONEndpoint) Visit

func (j *JSONEndpoint) Visit(s core.Secret)

Visit ...

type SecretsReader

type SecretsReader interface {
	Read(path string) (*vaultapi.Secret, error)
}

SecretsReader is just the Read portion of the Vault client API

type Vault

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

Vault implements the syncrets vault backend

func NewVaultBackend

func NewVaultBackend(viper *viper.Viper, args []string) (*Vault, error)

NewVaultBackend returns a vault backend based on the supplied arguments

func (*Vault) Authenticate

func (v *Vault) Authenticate() error

Authenticate with the backend vault server

func (*Vault) Delete

func (src *Vault) Delete(secret core.Secret) error

Delete ...

func (*Vault) GetClient

func (v *Vault) GetClient() VaultAPI

GetClient returns a VaultAPI

func (*Vault) GetName

func (v *Vault) GetName() string

GetName ...

func (*Vault) GetPath

func (v *Vault) GetPath() string

GetPath ...

func (*Vault) GetRawURL

func (v *Vault) GetRawURL() *url.URL

GetRawURL ...

func (*Vault) GetURL

func (v *Vault) GetURL() *url.URL

GetURL ...

func (*Vault) IsValid

func (v *Vault) IsValid() bool

IsValid checks if the session with the backend is still valid

func (*Vault) Load

func (v *Vault) Load() (string, error)

Load ...

func (*Vault) Store

func (v *Vault) Store()

Store ...

func (*Vault) Walk

func (src *Vault) Walk(visitor core.Visitor)

Walk the secrets...

func (*Vault) Write

func (src *Vault) Write(secret core.Secret) error

Write ...

type VaultAPI

type VaultAPI interface {
	SecretsReader
	List(path string) (*vaultapi.Secret, error)
	UserpassLogin(username string, password string) error
	TokenIsValid() bool
	Write(path string, data map[string]interface{}) (*vaultapi.Secret, error)
	Delete(path string) (*vaultapi.Secret, error)
	GetToken() string
	SetToken(token string)
}

VaultAPI is a composite API of all the Vault client APIs as interfaces

func NewVaultClient

func NewVaultClient(src *url.URL) (VaultAPI, error)

NewVaultClient creates a vaultClient using the supplied URL

Jump to

Keyboard shortcuts

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