storage

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Delete(string) error
	Get(string) (string, error)
	List(string) ([]string, error)
	GeneratePoliciesAndRoles(string, string, string, string, []string) error
	SecretPath(string, string) string
	Write(string, string, map[string]struct{}) error
}

Backend gives us basic methods for storing secrets

type PolicyTemplates

type PolicyTemplates struct {
	GeneralPolicyTemplate string
	MemberPolicyTemplate  string
	TeamPolicyTemplate    string
}

PolicyTemplates are used with Vault to give users permissions

type VaultStore

type VaultStore struct {
	*api.Client
}

VaultStore stores a Vault client

func NewVault

func NewVault() (*VaultStore, error)

NewVault will connect to a Vault server using VAULT_ADDR and VAUL_TOKEN variables

func (*VaultStore) Delete

func (v *VaultStore) Delete(path string) error

Delete will delete a secret from Vault

func (*VaultStore) GeneratePoliciesAndRoles

func (v *VaultStore) GeneratePoliciesAndRoles(directoryBackend, roleDir, policyDir, defaultTeam string, entities []string) error

GeneratePoliciesAndRoles will generate a set of policies for a given directory of entities

func (*VaultStore) Get

func (v *VaultStore) Get(path string) (string, error)

Get will return the stored secret at a given path

func (*VaultStore) List

func (v *VaultStore) List(login string) ([]string, error)

List will list a set of secrets available

func (*VaultStore) SecretPath

func (v *VaultStore) SecretPath(login, name string) string

SecretPath will return the path for a given secret

func (*VaultStore) Write

func (v *VaultStore) Write(filename, name string, targets map[string]struct{}) error

Write will write the provided secret to the given user

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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