api

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attributes

type Attributes map[string]string

Attributes is a map of configuration

func (*Attributes) GetPath

func (r *Attributes) GetPath(ns string) string

GetPath returns the uri of the config

func (*Attributes) IsOneshot

func (r *Attributes) IsOneshot() bool

IsOneshot checks if the attribute is a oneshot attribute

func (Attributes) IsValid

func (r Attributes) IsValid() error

IsValid validates the attributes

func (*Attributes) String

func (r *Attributes) String() string

func (*Attributes) URI

func (r *Attributes) URI() string

URI returns the uri for the config item

func (*Attributes) Values

func (r *Attributes) Values() map[string]string

Values retrieves the values from the attributes

type Auth

type Auth struct {
	// Path is the path of the authentication backend
	Path string `yaml:"path" json:"path" hcl:"path"`
	// Type is the authentication type
	Type string `yaml:"type" json:"type" hcl:"type"`
	// Description is the a description for the backend
	Description string `yaml:"description" json:"description" hcl:"description"`
	// Attributes is a map of configurations for the backend
	Attrs []*Attributes `yaml:"attributes" json:"attributes" hcl:"attributes"`
}

Auth defined a authentication backend

func (Auth) IsValid

func (r Auth) IsValid() error

IsValid validates the auth backend

type Backend

type Backend struct {
	// Path is the mountpoint for the mount
	Path string `yaml:"path" json:"path" hcl:"path"`
	// Description is the a description for the backend
	Description string `yaml:"description" json:"description" hcl:"description"`
	// Type is the type of backend
	Type string `yaml:"type" json:"type" hcl:"type"`
	// DefaultLeaseTTL is the default lease of the backend
	DefaultLeaseTTL time.Duration `yaml:"default-lease-ttl" json:"default-lease-ttl" hcl:"default-lease-ttl"`
	// MaxLeaseTTL is the max ttl
	MaxLeaseTTL time.Duration `yaml:"max-lease-ttl" json:"max-lease-ttl" hcl:"max-lease-ttl"`
	// Attrs is the configuration of the mount point
	Attrs []*Attributes `yaml:"attributes" json:"attributes" hcl:"attributes"`
}

Backend defined the type and configuration for a backend in vault

func (Backend) GetDefaultTTL

func (r Backend) GetDefaultTTL() string

GetDefaultTTL returns the default ttl

func (Backend) GetMaxTTL

func (r Backend) GetMaxTTL() string

GetMaxTTL returns the max ttl

func (Backend) GetPath

func (r Backend) GetPath() string

GetPath returns the backend path

func (Backend) IsValid

func (r Backend) IsValid() error

IsValid validates the backend is ok

func (Backend) String

func (r Backend) String() string

String returns a string representation of the backend

type Config

type Config struct {
	// Users is a series of users
	Users []*User `yaml:"users" json:"users" hcl:"users"`
	// Backends is a series of backend's
	Backends []*Backend `yaml:"backends" json:"backends" hcl:"backends"`
	// Secrets is a series of secrets
	Secrets []*Secret `yaml:"secrets" json:"secrets" hcl:"secrets"`
	// Auths is a series of authentication backend's
	Auths []*Auth `yaml:"auths" json:"auths" hcl:"auths"`
}

Config is the definition for a config file

type Secret

type Secret struct {
	// Path is key for this secret
	Path string `yaml:"path" json:"path" hcl:"path"`
	// Values is a series of values associated to the secret
	Values map[string]interface{} `yaml:"values" json:"values" hcl:"values"`
}

Secret defines a secret

func (Secret) IsValid

func (r Secret) IsValid() error

IsValid validates the secret is ok

type User

type User struct {
	// Path is the authentication path for the user
	Path string `yaml:"path" json:"path" hcl:"path"`
	// UserPass is the credentials for a userpass auth backend
	UserPass *UserCredentials `yaml:"userpass" json:"userpass" hcl:"userpass"`
	// Policies is a list of policies the user has access to
	Policies []string `yaml:"policies" json:"policies" hcl:"policies"`
	// Namespace is optional and used when adding to kubernetes
	Namespace string `yaml:"namespace" json:"namespace" hcl:"namespace"`
}

User is the definition for a user

func (User) GetPolicies

func (r User) GetPolicies() string

GetPolicies returns the policies associated to a user

func (*User) IsValid

func (r *User) IsValid() error

IsValid validates the user is ok

type UserCredentials

type UserCredentials struct {
	// Username is the id of the user
	Username string `yaml:"username" json:"username" hcl:"username"`
	// Password is the password of the user
	Password string `yaml:"password" json:"password" hcl:"password"`
}

UserCredentials are the userpass credentials

func (UserCredentials) IsValid

func (r UserCredentials) IsValid() error

IsValid validates the user credential is ok

Jump to

Keyboard shortcuts

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