vaultrole

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: 8 Imported by: 6

README

CircleCI

vaultrole

Package vaultrole provides primitives to more easily work with Vault roles.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAlreadyExists

func IsAlreadyExists(err error) bool

IsAlreadyExists asserts alreadyExistsError.

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsInvalidVaultResponse

func IsInvalidVaultResponse(err error) bool

IsInvalidVaultResponse asserts invalidVaultResponseError

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 Config

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

	CommonNameFormat string
}

func DefaultConfig

func DefaultConfig() Config

type CreateConfig

type CreateConfig struct {
	AllowBareDomains bool
	AllowSubdomains  bool
	AltNames         []string
	ID               string
	Organizations    []string
	TTL              string
}

type ExistsConfig

type ExistsConfig struct {
	ID            string
	Organizations []string
}

type Interface

type Interface interface {
	Create(config CreateConfig) error
	Exists(config ExistsConfig) (bool, error)
	Search(config SearchConfig) (Role, error)
	Update(config UpdateConfig) error
}

type Role

type Role struct {
	AllowBareDomains bool
	AllowSubdomains  bool
	AltNames         []string
	ID               string
	Organizations    []string
	TTL              time.Duration
}

type SearchConfig

type SearchConfig struct {
	ID            string
	Organizations []string
}

type UpdateConfig

type UpdateConfig struct {
	AllowBareDomains bool
	AllowSubdomains  bool
	AltNames         []string
	ID               string
	Organizations    []string
	TTL              string
}

type VaultRole

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

func New

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

func (*VaultRole) Create

func (r *VaultRole) Create(config CreateConfig) error

func (*VaultRole) Exists

func (r *VaultRole) Exists(config ExistsConfig) (bool, error)

func (*VaultRole) Search

func (r *VaultRole) Search(config SearchConfig) (Role, error)

func (*VaultRole) Update

func (r *VaultRole) Update(config UpdateConfig) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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