Documentation ¶
Index ¶
- Constants
- func SecureRandomPassword(alphabet string, length int) string
- type Builder
- type Command
- type Config
- func (c Config) Builder(deps Dependencies) Builder
- func (e *Config) GetDefaultClusterConfig() (*kube.ClusterConfig, error)
- func (e *Config) MarshalYAML() (interface{}, error)
- func (e *Config) Merge(other *Config)
- func (e *Config) SetFromPath(path string)
- func (e *Config) UnmarshalYAML(unmarshal func(interface{}) error) error
- type Dependencies
- type Environment
- func (e *Environment) AddOrUpdateSecretValue(groupName string, secretName string, value string) error
- func (e *Environment) AddSecretGroup(groupName string, keyConfig *SecretKeyConfig) error
- func (e *Environment) Cluster() *kube.Cluster
- func (e *Environment) ClusterForRoleExists(role core.ClusterRole) bool
- func (e *Environment) DeleteSecretGroup(groupName string) error
- func (e *Environment) Execute(ctx environmentvariables.Dependencies) error
- func (e *Environment) GetAppValueSetCollectionProvider(appName string) values.ValueSetCollectionProvider
- func (e *Environment) GetClusterConfig() *kube.ClusterConfig
- func (e *Environment) GetSecretConfig(groupName string, secretName string) (*SecretConfig, error)
- func (e *Environment) GetSecretGroup(name string) (group *SecretGroup, exists bool, loadErr error)
- func (e *Environment) GetSecretGroupConfig(groupName string) (*SecretGroupConfig, error)
- func (e *Environment) GetSecretGroupConfigs() ([]SecretGroupConfig, error)
- func (e *Environment) GetSecretValue(groupName string, secretName string) (string, error)
- func (e *Environment) GetValueSetCollection() values.ValueSetCollection
- func (e *Environment) GetVariablesAsMap(ctx environmentvariables.Dependencies) (map[string]string, error)
- func (e *Environment) HasCluster() bool
- func (e Environment) IsAppDisabled(appName string) bool
- func (e Environment) Matches(candidate EnvironmentFilterable) bool
- func (e *Environment) Render(ctx environmentvariables.Dependencies) (string, error)
- func (e *Environment) ResolveSecretPath(secretPath string) (string, error)
- func (e *Environment) Save() error
- func (e *Environment) Stack() *kube.Stack
- func (e *Environment) ValidateConsistency() error
- func (e *Environment) ValidateSecrets(secretPaths ...string) error
- type EnvironmentFilterable
- type Environmenter
- type LastpassKeyConfig
- type SecretConfig
- type SecretGenerationConfig
- type SecretGroup
- func (s *SecretGroup) AddOrUpdateSecret(value string, config *SecretConfig) error
- func (s *SecretGroup) AddOrUpdateSecretValue(name string, value string) error
- func (s *SecretGroup) DeleteAllSecretValues() error
- func (s *SecretGroup) DeleteSecretConfig(name string) error
- func (s *SecretGroup) DeleteSecretValue(name string) error
- func (s *SecretGroup) GetSecretValue(name string, generationConfig *SecretGenerationConfig) (string, error)
- func (s *SecretGroup) Save() error
- type SecretGroupConfig
- type SecretKeyConfig
- type SecretPath
- type SecretValues
Constants ¶
const (
DefaultPasswordAlphabet = "ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789"
)
Variables ¶
This section is empty.
Functions ¶
func SecureRandomPassword ¶
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func (Builder) Build ¶
func (b Builder) Build() (*Environment, error)
func (Builder) WithCluster ¶
func (Builder) WithEnvironment ¶
type Command ¶
type Command struct { FromPath string `yaml:"fromPath,omitempty" json:"fromPath,omitempty"` Name string `yaml:"name" json:"name"` Exec *command.CommandValue `yaml:"exec,omitempty" json:"exec,omitempty"` }
type Config ¶
type Config struct { Role core.EnvironmentRole `yaml:"role" json:"role"` ClusterRoles []string `yaml:"clusterRoles,omitempty" json:"clusterRoles,omitempty"` DefaultCluster string `yaml:"defaultCluster,omitempty" json:"defaultCluster"` Clusters kube.ClusterConfigs `yaml:"clusters,omitempty"` PullSecrets []kube.PullSecret `yaml:"pullSecrets,omitempty"` VaultNamespace string `yaml:"vaultNamespace,omitempty" json:"vaultNamespace,omitempty"` // If true, commands which would cause modifications to be deployed will // trigger a confirmation prompt. Protected bool `yaml:"protected" json:"protected"` IsLocal bool `yaml:"isLocal" json:"isLocal"` Commands []*Command `yaml:"commands,omitempty" json:"commands,omitempty"` Variables []*environmentvariables.Variable `yaml:"variables,omitempty" json:"variables,omitempty"` Scripts []*script.Script `yaml:"scripts,omitempty" json:"scripts,omitempty"` // Contains app value overrides which should be applied when deploying // apps to this environment. AppValues *values.ValueSet `yaml:"appValues,omitempty" json:"appValues"` ValueSetNames []string `yaml:"valueSets,omitempty" json:"valueSets,omitempty"` ValueOverrides *values.ValueSetCollection `yaml:"valueOverrides,omitempty"` // Deprecated AppValueOverrides map[string]values.ValueSetCollection `yaml:"appValueOverrides,omitempty"` // Apps which should not be deployed to this environment. // Deprecated AppBlacklist []string `yaml:"appBlacklist,omitempty"` // Apps which should be deployed to this environment, and any value overrides for them. If empty, all apps will be included except ones on AppBlacklist. Apps map[string]values.ValueSetCollection `yaml:"apps"` SecretGroupFilePaths map[string]string `yaml:"secretFiles"` }
func LoadConfig ¶
func (Config) Builder ¶
func (c Config) Builder(deps Dependencies) Builder
func (*Config) GetDefaultClusterConfig ¶
func (e *Config) GetDefaultClusterConfig() (*kube.ClusterConfig, error)
func (*Config) MarshalYAML ¶
func (*Config) SetFromPath ¶
func (*Config) UnmarshalYAML ¶
type Dependencies ¶
type Dependencies interface { environmentvariables.Dependencies WithEnv(environment *Environment) interface{} }
type Environment ¶
type Environment struct { Config // contains filtered or unexported fields }
func (*Environment) AddOrUpdateSecretValue ¶
func (e *Environment) AddOrUpdateSecretValue(groupName string, secretName string, value string) error
func (*Environment) AddSecretGroup ¶
func (e *Environment) AddSecretGroup(groupName string, keyConfig *SecretKeyConfig) error
AddSecretGroup creates or replaces a secret group using the provided key config.
func (*Environment) Cluster ¶
func (e *Environment) Cluster() *kube.Cluster
func (*Environment) ClusterForRoleExists ¶
func (e *Environment) ClusterForRoleExists(role core.ClusterRole) bool
func (*Environment) DeleteSecretGroup ¶
func (e *Environment) DeleteSecretGroup(groupName string) error
func (*Environment) Execute ¶
func (e *Environment) Execute(ctx environmentvariables.Dependencies) error
func (*Environment) GetAppValueSetCollectionProvider ¶
func (e *Environment) GetAppValueSetCollectionProvider(appName string) values.ValueSetCollectionProvider
GetAppValueSetCollectionProvider returns a ValuesSetCollectionProvider that will provide any values set collection defined in this environment for a specific app. If none is defined, an instance that does nothing will be returned.
func (*Environment) GetClusterConfig ¶
func (e *Environment) GetClusterConfig() *kube.ClusterConfig
func (*Environment) GetSecretConfig ¶
func (e *Environment) GetSecretConfig(groupName string, secretName string) (*SecretConfig, error)
func (*Environment) GetSecretGroup ¶
func (e *Environment) GetSecretGroup(name string) (group *SecretGroup, exists bool, loadErr error)
GetSecretGroup gets the secret group with the provided name. If the group does not exist, the returned bool will be false. If the group could not be loaded, the error will not be nil.
func (*Environment) GetSecretGroupConfig ¶
func (e *Environment) GetSecretGroupConfig(groupName string) (*SecretGroupConfig, error)
func (*Environment) GetSecretGroupConfigs ¶
func (e *Environment) GetSecretGroupConfigs() ([]SecretGroupConfig, error)
func (*Environment) GetSecretValue ¶
func (e *Environment) GetSecretValue(groupName string, secretName string) (string, error)
func (*Environment) GetValueSetCollection ¶
func (e *Environment) GetValueSetCollection() values.ValueSetCollection
func (*Environment) GetVariablesAsMap ¶
func (e *Environment) GetVariablesAsMap(ctx environmentvariables.Dependencies) (map[string]string, error)
func (*Environment) HasCluster ¶
func (e *Environment) HasCluster() bool
func (Environment) IsAppDisabled ¶
func (e Environment) IsAppDisabled(appName string) bool
IsAppDisabled returns true if the app is disabled for the environment. Apps are assumed to be disabled for the environment unless they are in the app list and not marked as disabled
func (Environment) Matches ¶
func (e Environment) Matches(candidate EnvironmentFilterable) bool
func (*Environment) Render ¶
func (e *Environment) Render(ctx environmentvariables.Dependencies) (string, error)
func (*Environment) ResolveSecretPath ¶
func (e *Environment) ResolveSecretPath(secretPath string) (string, error)
func (*Environment) Save ¶
func (e *Environment) Save() error
func (*Environment) Stack ¶
func (e *Environment) Stack() *kube.Stack
func (*Environment) ValidateConsistency ¶
func (e *Environment) ValidateConsistency() error
func (*Environment) ValidateSecrets ¶
func (e *Environment) ValidateSecrets(secretPaths ...string) error
type EnvironmentFilterable ¶
type EnvironmentFilterable interface { GetEnvironmentRoles() (core.EnvironmentRoles, bool) GetEnvironmentName() (string, bool) }
type Environmenter ¶
type Environmenter interface {
Environment() Environment
}
type LastpassKeyConfig ¶
type SecretConfig ¶
type SecretConfig struct { Name string `yaml:"name"` Description string `yaml:"description"` Generation *SecretGenerationConfig `yaml:"generation,omitempty"` }
type SecretGenerationConfig ¶
type SecretGenerationConfig struct {
Length int `yaml:"length"`
}
type SecretGroup ¶
type SecretGroup struct {
// contains filtered or unexported fields
}
func NewSecretGroup ¶
func NewSecretGroup(config *SecretGroupConfig) (*SecretGroup, error)
Creates an in-memory secret group from the given config, with secret values decrypted.
func (*SecretGroup) AddOrUpdateSecret ¶
func (s *SecretGroup) AddOrUpdateSecret(value string, config *SecretConfig) error
AddOrUpdateSecretValue adds or replaces an existing secret, then saves the group.
func (*SecretGroup) AddOrUpdateSecretValue ¶
func (s *SecretGroup) AddOrUpdateSecretValue(name string, value string) error
func (*SecretGroup) DeleteAllSecretValues ¶
func (s *SecretGroup) DeleteAllSecretValues() error
DeleteAllSecretValues drops all secret values, then saves the group.
func (*SecretGroup) DeleteSecretConfig ¶
func (s *SecretGroup) DeleteSecretConfig(name string) error
DeleteSecretConfig deletes a secret config (and the value) from the group, then saves the group.
func (*SecretGroup) DeleteSecretValue ¶
func (s *SecretGroup) DeleteSecretValue(name string) error
DeleteSecret deletes the value of a secret (but not the config) from the group, then saves the group.
func (*SecretGroup) GetSecretValue ¶
func (s *SecretGroup) GetSecretValue(name string, generationConfig *SecretGenerationConfig) (string, error)
func (*SecretGroup) Save ¶
func (s *SecretGroup) Save() error
Save encrypts the secret values and saves them to disk.
type SecretGroupConfig ¶
type SecretGroupConfig struct { Secrets []*SecretConfig `yaml:"secrets"` Key *SecretKeyConfig `yaml:"key"` SecretValues string `yaml:"secretValues"` // contains filtered or unexported fields }
type SecretKeyConfig ¶
type SecretKeyConfig struct { Prompt bool `yaml:"prompt,omitempty"` EnvironmentVariable string `yaml:"environmentVariable,omitempty"` UnsafeStoredPassphrase string `yaml:"UNSAFE,omitempty"` Lastpass *LastpassKeyConfig `yaml:"lastpass,omitempty"` Nonce string `yaml:"nonce"` Salt string `yaml:"salt"` // contains filtered or unexported fields }
func (*SecretKeyConfig) GetKeyComponents ¶
func (s *SecretKeyConfig) GetKeyComponents(secretGroupName string) (key []byte, nonce []byte, err error)
type SecretPath ¶
type SecretPath struct { GroupName string SecretName string Generation *SecretGenerationConfig }
func ParseSecretPath ¶
func ParseSecretPath(in string) (*SecretPath, error)