config

package
v3.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2019 License: BSD-3-Clause Imports: 32 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

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	Name        string
	Environment *Environment
}

Application ...

type Applications

type Applications []*Application

Applications ...

type Audit

type Audit struct {
	Description string `hcl:"description"`
	Environment *Environment
	Key         string
	Local       bool                   `hcl:"local"`
	Options     map[string]interface{} `hcl:"options"`
	Path        string                 `hcl:"path"`
	Type        string                 `hcl:"type"`
}

Secret ...

func (*Audit) Equal

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

Equal ...

func (*Audit) ToMap

func (s *Audit) ToMap() map[string]interface{}

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

	ConsulKVs      ConsulKVs
	ConsulServices ConsulServices
	Environments   Environments

	VaultAuths    VaultAuths
	VaultMounts   VaultMounts
	VaultPolicies VaultPolicies
	VaultSecrets  VaultSecrets
	VaultAudits   VaultAudits
	// contains filtered or unexported fields
}

Config ...

func NewConfigFromCLI

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

NewConfigFromCLI will take a CLI context and create config from it

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

type ConsulService

type ConsulService api.CatalogRegistration

ConsulService ...

func (*ConsulService) ToConsulService

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

ToConsulService ...

type ConsulServices

type ConsulServices []*ConsulService

ConsulServices struct

type Environment

type Environment struct {
	Name         string
	Applications Applications
}

Environment struct

type Environments

type Environments []*Environment

Environments struct

func (*Environments) Contains

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

Containts ...

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 Scratch

type Scratch struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Scratch is a wrapper around a map which is used by the template.

func (*Scratch) Get

func (s *Scratch) Get(k string) interface{}

Get returns a value previously set by Add or Set

func (*Scratch) Key

func (s *Scratch) Key(k string) bool

Key returns a boolean indicating whether the given key exists in the map.

func (*Scratch) MapGet

func (s *Scratch) MapGet(k, mk string) (interface{}, error)

Get returns a value previously set by Add or Set

func (*Scratch) MapSet

func (s *Scratch) MapSet(k, mk string, v interface{}) (string, error)

MapSet stores the value v into a key mk in the map named k.

func (*Scratch) MapSetX

func (s *Scratch) MapSetX(k, mk string, v interface{}) (string, error)

MapSetX behaves the same as MapSet, except it will not overwrite the map key if it already exists.

func (*Scratch) MapValues

func (s *Scratch) MapValues(k string) ([]interface{}, error)

MapValues returns the list of values in the map sorted by key.

func (*Scratch) Set

func (s *Scratch) Set(k string, v interface{}) string

Set stores the value v at the key k. It will overwrite an existing value if present.

func (*Scratch) SetX

func (s *Scratch) SetX(k string, v interface{}) string

SetX behaves the same as Set, except it will not overwrite existing keys if already present.

type Secret

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

Secret ...

func (*Secret) Equal

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

Equal ...

type VaultAudits

type VaultAudits []*Audit

VaultAudits struct

environment -> application

func (*VaultAudits) Add

func (e *VaultAudits) Add(audit *Audit) bool

Add ...

func (*VaultAudits) Exists

func (e *VaultAudits) Exists(audit *Audit) bool

Exists ...

func (*VaultAudits) Get

func (e *VaultAudits) Get(audit *Audit) *Audit

Get ...

func (*VaultAudits) GetOrSet

func (e *VaultAudits) GetOrSet(audit *Audit) *Audit

GetOrSet ...

func (*VaultAudits) List

func (e *VaultAudits) List() []string

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 ...

func (*VaultSecrets) List

func (e *VaultSecrets) List() []string

Jump to

Keyboard shortcuts

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