config

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2018 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DenyCapability   = "deny"
	CreateCapability = "create"
	ReadCapability   = "read"
	UpdateCapability = "update"
	DeleteCapability = "delete"
	ListCapability   = "list"
	SudoCapability   = "sudo"
	RootCapability   = "root"

	// Backwards compatibility
	OldDenyPathPolicy  = "deny"
	OldReadPathPolicy  = "read"
	OldWritePathPolicy = "write"
	OldSudoPathPolicy  = "sudo"
)
View Source
const (
	DenyCapabilityInt uint32 = 1 << iota
	CreateCapabilityInt
	ReadCapabilityInt
	UpdateCapabilityInt
	DeleteCapabilityInt
	ListCapabilityInt
	SudoCapabilityInt
)

Variables

View Source
var DefaultConcurrency int

DefaultConcurrency ...

View Source
var TargetApplication string

TargetApplication ...

View Source
var TargetEnvironment string

TargetEnvironment ...

Functions

This section is empty.

Types

type Application

type Application struct {
	Name        string
	Environment *Environment
}

Application ...

func (*Application) Equal

func (a *Application) Equal(o *Application) bool

Equal ...

type Applications

type Applications []*Application

Applications ...

func (*Applications) Add

func (a *Applications) Add(application *Application)

Add ...

func (*Applications) Exists

func (a *Applications) Exists(application *Application) bool

Exists ...

func (*Applications) Get

func (a *Applications) Get(application *Application) *Application

Get ...

func (*Applications) GetOrSet

func (a *Applications) GetOrSet(application *Application) *Application

GetOrSet ...

type Auth

type Auth struct {
	Environment     *Environment
	Name            string
	Type            string
	Description     string
	DefaultLeaseTTL string
	MaxLeaseTTL     string
	Config          []*AuthConfig
	Roles           []*AuthRole
}

Auth struct ...

type AuthConfig

type AuthConfig struct {
	Name string
	Data map[string]interface{}
}

AuthConfig ...

type AuthRole

type AuthRole struct {
	Name string
	Data map[string]interface{}
}

AuthRole ...

type Config

type Config struct {
	Applications   Applications
	Environments   Environments
	VaultMounts    VaultMounts
	VaultPolicies  VaultPolicies
	VaultSecrets   VaultSecrets
	VaultAuths     VaultAuths
	ConsulServices ConsulServices
	ConsulKVs      ConsulKVs
}

Config ...

func NewConfig

func NewConfig(path string) (*Config, error)

NewConfig will create a new Config struct based on a directory

func NewConfigFromCLI

func NewConfigFromCLI(c *cli.Context) (*Config, error)

NewConfigFromCLI will take a CLI context and create config from it

func (*Config) AddFile

func (c *Config) AddFile(file string) error

AddFile to the config struct

func (*Config) ScanDirectory

func (c *Config) ScanDirectory(directory string) error

ScanDirectory ...

type ConsulKV

type ConsulKV struct {
	Application *Application
	Environment *Environment
	Key         string
	Value       []byte
}

ConsulKV ...

func (*ConsulKV) ToConsulKV

func (c *ConsulKV) ToConsulKV() *api.KVPair

ToConsulKV ...

type ConsulKVs

type ConsulKVs []*ConsulKV

ConsulKV struct

func (*ConsulKVs) Add

func (cs *ConsulKVs) Add(kv *ConsulKV)

Add ...

type ConsulService

type ConsulService api.CatalogRegistration

ConsulService ...

func (*ConsulService) ToConsulService

func (c *ConsulService) ToConsulService() *api.CatalogRegistration

ToConsulService ...

type ConsulServices

type ConsulServices []*ConsulService

ConsulServices struct

func (*ConsulServices) Add

func (cs *ConsulServices) Add(service *ConsulService)

Add ...

type Environment

type Environment struct {
	Name         string
	Applications Applications
}

Environment struct

func (*Environment) Equal

func (e *Environment) Equal(o *Environment) bool

Equal ...

type Environments

type Environments []*Environment

Environments struct

func (*Environments) Add

func (e *Environments) Add(environment *Environment)

Add ...

func (*Environments) Contains

func (e *Environments) Contains(environmentName string) bool

Containts ...

func (*Environments) Exists

func (e *Environments) Exists(environment *Environment) bool

Exists ...

func (*Environments) Get

func (e *Environments) Get(environment *Environment) *Environment

Get ...

func (*Environments) GetOrSet

func (e *Environments) GetOrSet(environment *Environment) *Environment

GetOrSet ...

type Mount

type Mount struct {
	Environment     *Environment
	Name            string
	Type            string
	Description     string
	DefaultLeaseTTL string
	MaxLeaseTTL     string
	ForceNoCache    bool
	Config          []*MountConfig
	Roles           MountRoles
}

Mount struct ...

func (*Mount) AuthInput

func (m *Mount) AuthInput() *api.MountInput

AuthInput ...

func (*Mount) MountInput

func (m *Mount) MountInput() *api.MountInput

MountInput ...

type MountConfig

type MountConfig struct {
	Name string
	Data map[string]interface{}
}

MountConfig ...

type MountRole

type MountRole struct {
	Name string
	Data map[string]interface{}
}

MountRole ...

type MountRoles

type MountRoles []*MountRole

MountRoles ...

func (*MountRoles) Add

func (r *MountRoles) Add(role *MountRole)

Add ...

type PathCapabilities

type PathCapabilities struct {
	Prefix       string
	Policy       string
	Permissions  *Permissions
	Glob         bool
	Capabilities []string

	// These keys are used at the top level to make the HCL nicer; we store in
	// the Permissions object though
	MinWrappingTTLHCL    interface{}              `hcl:"min_wrapping_ttl"`
	MaxWrappingTTLHCL    interface{}              `hcl:"max_wrapping_ttl"`
	AllowedParametersHCL map[string][]interface{} `hcl:"allowed_parameters"`
	DeniedParametersHCL  map[string][]interface{} `hcl:"denied_parameters"`
}

PathCapabilities represents a policy for a path in the namespace.

type Permissions

type Permissions struct {
	CapabilitiesBitmap uint32
	MinWrappingTTL     time.Duration
	MaxWrappingTTL     time.Duration
	AllowedParameters  map[string][]interface{}
	DeniedParameters   map[string][]interface{}
}

type Policy

type Policy struct {
	Environment *Environment
	Application *Application
	Name        string              `hcl:"name"`
	Paths       []*PathCapabilities `hcl:"-"`
	Raw         string
}

Policy is used to represent the policy specified by an ACL configuration.

func (*Policy) Equal

func (p *Policy) Equal(o *Policy) bool

Equal ...

type Secret

type Secret struct {
	Application *Application
	Environment *Environment
	Path        string
	Key         string
	Secret      *api.Secret
	// contains filtered or unexported fields
}

Secret ...

func (*Secret) Equal

func (s *Secret) Equal(o *Secret) bool

Equal ...

type VaultAuths

type VaultAuths []*Auth

VaultAuths struct

environment

func (*VaultAuths) Add

func (m *VaultAuths) Add(auth *Auth)

Add ...

type VaultMounts

type VaultMounts []*Mount

VaultMounts struct

environment

func (*VaultMounts) Add

func (m *VaultMounts) Add(mount *Mount)

Add ...

func (*VaultMounts) Find

func (m *VaultMounts) Find(name string) *Mount

Find ...

type VaultPolicies

type VaultPolicies []*Policy

VaultPolicies ...

func (*VaultPolicies) Add

func (p *VaultPolicies) Add(policy *Policy) bool

Add ...

func (*VaultPolicies) Exists

func (p *VaultPolicies) Exists(policy *Policy) bool

Exists ...

type VaultSecrets

type VaultSecrets []*Secret

VaultSecrets struct

environment -> application

func (*VaultSecrets) Add

func (e *VaultSecrets) Add(secret *Secret) bool

Add ...

func (*VaultSecrets) Exists

func (e *VaultSecrets) Exists(secret *Secret) bool

Exists ...

func (*VaultSecrets) Get

func (e *VaultSecrets) Get(secret *Secret) *Secret

Get ...

func (*VaultSecrets) GetOrSet

func (e *VaultSecrets) GetOrSet(secret *Secret) *Secret

GetOrSet ...

Jump to

Keyboard shortcuts

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