Documentation
¶
Index ¶
- Constants
- Variables
- type GenVarsConfig
- func (c *GenVarsConfig) Config() GenVarsConfig
- func (c *GenVarsConfig) EnvSubstEnabled() bool
- func (c *GenVarsConfig) KeySeparator() string
- func (c *GenVarsConfig) LaxModeEnabled() bool
- func (c *GenVarsConfig) OutputPath() string
- func (c *GenVarsConfig) TokenSeparator() string
- func (c *GenVarsConfig) Validate() error
- func (c *GenVarsConfig) WithEnvSubst(enabled bool) *GenVarsConfig
- func (c *GenVarsConfig) WithKeySeparator(keySeparator string) *GenVarsConfig
- func (c *GenVarsConfig) WithLaxMode(enabled bool) *GenVarsConfig
- func (c *GenVarsConfig) WithOutputPath(out string) *GenVarsConfig
- func (c *GenVarsConfig) WithTokenSeparator(tokenSeparator string) *GenVarsConfig
- type ImplementationPrefix
- type ParsedTokenConfig
- func (t *ParsedTokenConfig) Keypathless() string
- func (t *ParsedTokenConfig) LookupKeys() string
- func (t *ParsedTokenConfig) Metadaless() string
- func (t *ParsedTokenConfig) Metadata() string
- func (t *ParsedTokenConfig) ParseMetadata(metadataTyp any) error
- func (t *ParsedTokenConfig) Prefix() ImplementationPrefix
- func (t *ParsedTokenConfig) StoreToken() string
- func (t *ParsedTokenConfig) String() string
- func (t *ParsedTokenConfig) TokenSeparator() string
- func (ptc *ParsedTokenConfig) WithKeyPath(kp string)
- func (ptc *ParsedTokenConfig) WithMetadata(md string)
- func (ptc *ParsedTokenConfig) WithSanitizedToken(v string)
Constants ¶
const ( SELF_NAME = "configmanager" // CONFIGMANAGER_DIR is used for any operations that require a lookup of dependencies/providers // // If it is empty or unset the default locations for these is `$PWD/.configmanager` and then `~/.configmanager` CONFIGMANAGER_DIR string = "CONFIGMANAGER_DIR" )
Variables ¶
var (
ErrConfigValidation = errors.New("config validation failed")
)
var ErrInvalidTokenPrefix = errors.New("token prefix has no implementation")
Parsed token config section
Functions ¶
This section is empty.
Types ¶
type GenVarsConfig ¶
type GenVarsConfig struct {
// contains filtered or unexported fields
}
GenVarsConfig defines the input config object to be passed
func NewConfig ¶
func NewConfig() *GenVarsConfig
NewConfig returns a new GenVarsConfig with default values
keySeparator should be only a single character
func (*GenVarsConfig) Config ¶
func (c *GenVarsConfig) Config() GenVarsConfig
Config returns the derefed value
func (*GenVarsConfig) EnvSubstEnabled ¶
func (c *GenVarsConfig) EnvSubstEnabled() bool
EnvSubstEnabled returns whether or not envsubst is enabled
func (*GenVarsConfig) KeySeparator ¶
func (c *GenVarsConfig) KeySeparator() string
KeySeparator returns the keySeparator set in the config
func (*GenVarsConfig) LaxModeEnabled ¶
func (c *GenVarsConfig) LaxModeEnabled() bool
LaxModeEnabled returns whether or not lax mode is enabled
It is disabled by default which will break the existing v2 behaviour
func (*GenVarsConfig) OutputPath ¶
func (c *GenVarsConfig) OutputPath() string
OutputPath returns the outpath set in the config
func (*GenVarsConfig) TokenSeparator ¶
func (c *GenVarsConfig) TokenSeparator() string
TokenSeparator returns the tokenSeparator set in the config
func (*GenVarsConfig) Validate ¶
func (c *GenVarsConfig) Validate() error
Config returns the derefed value
func (*GenVarsConfig) WithEnvSubst ¶
func (c *GenVarsConfig) WithEnvSubst(enabled bool) *GenVarsConfig
WithEnvSubst adds env subst flag
func (*GenVarsConfig) WithKeySeparator ¶
func (c *GenVarsConfig) WithKeySeparator(keySeparator string) *GenVarsConfig
WithKeySeparator adds a custom key separotor
func (*GenVarsConfig) WithLaxMode ¶
func (c *GenVarsConfig) WithLaxMode(enabled bool) *GenVarsConfig
WithLaxMode adds lax mode enabled flag
func (*GenVarsConfig) WithOutputPath ¶
func (c *GenVarsConfig) WithOutputPath(out string) *GenVarsConfig
WithOutputPath
func (*GenVarsConfig) WithTokenSeparator ¶
func (c *GenVarsConfig) WithTokenSeparator(tokenSeparator string) *GenVarsConfig
WithTokenSeparator adds a custom token separator token is the actual value of the parameter/secret in the provider store
type ImplementationPrefix ¶
type ImplementationPrefix string
const ( // AWS SecretsManager prefix SecretMgrPrefix ImplementationPrefix = "AWSSECRETS" // AWS Parameter Store prefix ParamStorePrefix ImplementationPrefix = "AWSPARAMSTR" // Azure Key Vault Secrets prefix AzKeyVaultSecretsPrefix ImplementationPrefix = "AZKVSECRET" // Azure Key Vault Secrets prefix AzTableStorePrefix ImplementationPrefix = "AZTABLESTORE" // Azure App Config prefix AzAppConfigPrefix ImplementationPrefix = "AZAPPCONF" // Hashicorp Vault prefix HashicorpVaultPrefix ImplementationPrefix = "VAULT" // GcpSecrets GcpSecretsPrefix ImplementationPrefix = "GCPSECRETS" // Unknown UnknownPrefix ImplementationPrefix = "UNKNOWN" )
type ParsedTokenConfig ¶
type ParsedTokenConfig struct {
// contains filtered or unexported fields
}
func NewParsedToken ¶
func NewParsedToken(prefix ImplementationPrefix, config GenVarsConfig) (*ParsedTokenConfig, error)
NewParsedToken initialises a *ParsedTokenConfig
func (*ParsedTokenConfig) Keypathless ¶
func (t *ParsedTokenConfig) Keypathless() string
Keypathless returns the token without the key and metadata attributes Token will include the ImplementationPrefix + token separator + path to item
func (*ParsedTokenConfig) LookupKeys ¶
func (t *ParsedTokenConfig) LookupKeys() string
func (*ParsedTokenConfig) Metadaless ¶
func (t *ParsedTokenConfig) Metadaless() string
func (*ParsedTokenConfig) Metadata ¶
func (t *ParsedTokenConfig) Metadata() string
func (*ParsedTokenConfig) ParseMetadata ¶
func (t *ParsedTokenConfig) ParseMetadata(metadataTyp any) error
func (*ParsedTokenConfig) Prefix ¶
func (t *ParsedTokenConfig) Prefix() ImplementationPrefix
func (*ParsedTokenConfig) StoreToken ¶
func (t *ParsedTokenConfig) StoreToken() string
StoreToken returns the sanitized token without:
- metadata
- keySeparator
- keys
- prefix
func (*ParsedTokenConfig) String ¶
func (t *ParsedTokenConfig) String() string
Full returns the full Token path. Including key separator and metadata values
func (*ParsedTokenConfig) TokenSeparator ¶
func (t *ParsedTokenConfig) TokenSeparator() string
func (*ParsedTokenConfig) WithKeyPath ¶
func (ptc *ParsedTokenConfig) WithKeyPath(kp string)
func (*ParsedTokenConfig) WithMetadata ¶
func (ptc *ParsedTokenConfig) WithMetadata(md string)
func (*ParsedTokenConfig) WithSanitizedToken ¶
func (ptc *ParsedTokenConfig) WithSanitizedToken(v string)