vault

package
v0.0.0-...-bb8a427 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidRoleKind errInvalidRoleKind

ErrInvalidRoleKind is returned when attempting to parse a role with an invalid kind

Functions

func AddPolicies

func AddPolicies(ctx context.Context, log klog.Logger, name string, opts Opts) error

AddPolicies creates a vault client and uploads policies from a directory

func AddPolicyDir

func AddPolicyDir(ctx context.Context, log klog.Logger, client VaultClient, fsys fs.FS, opts Opts) error

AddPolicyDir uploads policies from a directory to vault

func AddRoles

func AddRoles(ctx context.Context, log klog.Logger, name string, opts Opts) error

AddRoles creates a vault client and uploads roles from a directory

func AddRolesDir

func AddRolesDir(ctx context.Context, log klog.Logger, client VaultClient, fsys fs.FS, opts Opts) error

AddRolesDir uploads roles from a directory to vault

Types

type HTTPVaultClient

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

HTTPVaultClient interacts with vault via its http api

func NewHTTPVaultClient

func NewHTTPVaultClient() (*HTTPVaultClient, error)

NewHTTPVaultClient creates a new HTTPVaultClient

func (*HTTPVaultClient) PutPolicy

func (v *HTTPVaultClient) PutPolicy(name, rules string) error

PutPolicy uploads a policy to vault

func (*HTTPVaultClient) PutRole

func (v *HTTPVaultClient) PutRole(mount, name string, body map[string]interface{}) error

PutRole uploads a role to vault

type Opts

type Opts struct {
	DryRun bool
}

Opts are vault client opts

type VaultClient

type VaultClient interface {
	PutPolicy(name, rules string) error
	PutRole(mount, name string, body map[string]interface{}) error
}

VaultClient interacts with vault

Jump to

Keyboard shortcuts

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