api

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2016 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attributes

type Attributes map[string]interface{}

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]interface{}

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"`
	// Policies is a series of policies
	Policies []*Policy `yaml:"policies" json:"policies" hcl:"policies"`
}

Config is the definition for a config file

type Policy added in v0.0.6

type Policy struct {
	// Name is the name of the policy
	Name string `yaml:"name" json:"name" hcl:"name"`
	// Policy is the policy itsefl
	Policy string `yaml:"policy" json:"policy" hcl:"policy"`
}

Policy defines a vault policy

func (Policy) IsValid added in v0.0.6

func (r Policy) IsValid() error

IsValid validates the policy is ok

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 *UserPass `yaml:"userpass" json:"userpass" hcl:"userpass"`
	// UserToken is a token struct for this user
	UserToken *UserToken `yaml:"usertoken" json:"usertoken" hcl:"usertoken"`
	// 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

func (User) Username added in v0.0.4

func (r User) Username() string

type UserPass added in v0.0.4

type UserPass 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 (UserPass) IsValid added in v0.0.4

func (r UserPass) IsValid() error

IsValid validates the user credential is ok

type UserToken added in v0.0.4

type UserToken struct {
	// ID is the actual token itselg
	ID string `yaml:"id" json:"id" hcl:"id"`
	// TTL is the time duration of the token
	TTL time.Duration `yaml:"ttl" json:"ttp" hcl:"ttl"`
	// DisplayName is a generic name for the token
	DisplayName string `yaml:"display-name" json:"display-name" hcl:"display-name"`
	// MaxUses is the max number of times the token can be used
	MaxUses int `yaml:"max-uses" json:"max-uses" hcl:"max-uses"`
}

UserToken is the token

func (UserToken) IsValid added in v0.0.4

func (r UserToken) IsValid() error

IsValid checks the user token is valid

Jump to

Keyboard shortcuts

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