vault

package
v0.0.0-...-80d90ea Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(c *config.AppConfig) (client *api.Client, err error)

func NewDest

func NewDest(c *config.AppConfig) (*api.Client, error)

func ToJson

func ToJson(o interface{}) (j []byte, err error)

toJson converts an arbitrary object into JSON and returns in bytes

Types

type Client

type Client struct {
	Client *api.Client
}

func (*Client) DeleteSecret

func (v *Client) DeleteSecret(appConfig *config.AppConfig, secretPath string, destinationVault bool) error

DeleteSecret delets a single secret from the vault

func (*Client) DumpSecrets

func (v *Client) DumpSecrets(appConfig *config.AppConfig, destinationVault bool)

DumpSecrets dumps all the secrets within the vault recursiviely

func (*Client) GetClient

func (v *Client) GetClient() *api.Client

GetClient returns the underlining client

func (*Client) HealthCheck

func (v *Client) HealthCheck(appConfig *config.AppConfig, destinationVault bool) (status string, err error)

HealthCheck performs a health check on the vault server

func (*Client) ListSecrets

func (v *Client) ListSecrets(appConfig *config.AppConfig, destinationVault bool)

ListSecrets lists secrets located at the provided path

func (*Client) ListVaultMounts

func (v *Client) ListVaultMounts(appConfig *config.AppConfig, destinationVault bool) (vaultMounts map[string]*api.MountOutput, err error)

ListVaultMounts lists the mounts within the vault

func (*Client) ReadSecret

func (v *Client) ReadSecret(appConfig *config.AppConfig, path string, destinationVault bool) (*api.Secret, error)

ReadSecret reads a single secret from the vault

func (*Client) RemoveOrphans

func (v *Client) RemoveOrphans(appConfig *config.AppConfig, path string) (secretPaths []string, err error)

RemoveOprhans removes secret paths in the destination vault that no longer exist in the source vault

func (*Client) Request

func (v *Client) Request(appConfig *config.AppConfig, destinationVault bool, method, uri string, body interface{}) (*http.Response, error)

Request performs a request with a vault client

func (*Client) SyncSecret

func (v *Client) SyncSecret(appConfig *config.AppConfig, path string) error

SyncSecret syncs a single secret from source to destination vault

func (*Client) SyncSecrets

func (v *Client) SyncSecrets(appConfig *config.AppConfig)

SyncSecrets syncs all secrets from source to destination vault

func (*Client) WriteSecret

func (v *Client) WriteSecret(appConfig *config.AppConfig, secret *Secret, destinationVault bool) error

WriteSecret writes a single secret to the vault

type Secret

type Secret struct {
	Path   string
	Values map[string]interface{}
}

Jump to

Keyboard shortcuts

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