role

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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.

Types

type Config

type Config struct {
	// Dependencies.
	VaultClient *vaultclient.Client

	// Settings.
	PKIMountpoint string
}

Config defines configurable aspects (such as dependencies) of this service.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns a default configuration that can be used to create this service.

type CreateParams

type CreateParams struct {
	AllowBareDomains bool   `json:"allow_bare_domains"`
	AllowSubdomains  bool   `json:"allow_sub_domains"`
	AllowedDomains   string `json:"allowed_domains"`
	Name             string `json:"name"`
	Organizations    string `json:"organizations"`
	TTL              string `json:"ttl"`
}

CreateParams represent the parameters for creating a role.

type Service

type Service interface {

	// Create creates a role.
	Create(params CreateParams) error

	// IsRoleCreated checks whether a given role exists.
	IsRoleCreated(roleName string) (bool, error)
}

Service manages the setup of Vault's PKI backends and all other required steps necessary to be done.

func New

func New(config Config) (Service, error)

New takes a configuration and returns a configured service.

Jump to

Keyboard shortcuts

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