vaultpki

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2020 License: Apache-2.0 Imports: 6 Imported by: 6

README

CircleCI

vaultpki

Package vaultpki provides primitives to more easily work with Vault PKI backends.

Documentation

Index

Constants

View Source
const (
	// MountType is the mount type used to mount a PKI backend in Vault.
	MountType = "pki"
)

Variables

This section is empty.

Functions

func IsExecutionFailed

func IsExecutionFailed(err error) bool

IsExecutionFailed asserts executionFailedError.

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsNoVaultHandlerDefined

func IsNoVaultHandlerDefined(err error) bool

IsNoVaultHandlerDefined asserts a dirty string matching against the error message provided by err. This is necessary due to the poor error handling design of the Vault library we are using.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound asserts notFoundError.

Types

type CertificateAuthority added in v0.1.3

type CertificateAuthority struct {
	Certificate string
	PrivateKey  string
}

func DefaultCertificateAuthority added in v0.1.3

func DefaultCertificateAuthority() CertificateAuthority

type Config

type Config struct {
	Logger      micrologger.Logger
	VaultClient *vaultapi.Client

	CATTL            string
	CommonNameFormat string
}

func DefaultConfig

func DefaultConfig() Config

type Interface

type Interface interface {
	BackendExists(ID string) (bool, error)
	CAExists(ID string) (bool, error)
	CreateBackend(ID string) error
	CreateCA(ID string) (CertificateAuthority, error)
	CreateCAWithPrivateKey(ID string) (CertificateAuthority, error)
	DeleteBackend(ID string) error
	GetBackend(ID string) (*vaultapi.MountOutput, error)
	GetCACertificate(ID string) (CertificateAuthority, error)
	ListBackends() (map[string]*vaultapi.MountOutput, error)
}

type VaultPKI

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

func New

func New(config Config) (*VaultPKI, error)

func (*VaultPKI) BackendExists

func (p *VaultPKI) BackendExists(ID string) (bool, error)

func (*VaultPKI) CAExists

func (p *VaultPKI) CAExists(ID string) (bool, error)

func (*VaultPKI) CreateBackend

func (p *VaultPKI) CreateBackend(ID string) error

func (*VaultPKI) CreateCA

func (p *VaultPKI) CreateCA(ID string) (CertificateAuthority, error)

func (*VaultPKI) CreateCAWithPrivateKey added in v0.1.3

func (p *VaultPKI) CreateCAWithPrivateKey(ID string) (CertificateAuthority, error)

func (*VaultPKI) DeleteBackend

func (p *VaultPKI) DeleteBackend(ID string) error

func (*VaultPKI) GetBackend

func (p *VaultPKI) GetBackend(ID string) (*vaultapi.MountOutput, error)

func (*VaultPKI) GetCACertificate

func (p *VaultPKI) GetCACertificate(ID string) (CertificateAuthority, error)

GetCACertificate returns the public key of the root CA of the PKI backend associated to the given ID, if any.

func (*VaultPKI) ListBackends

func (p *VaultPKI) ListBackends() (map[string]*vaultapi.MountOutput, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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