Documentation
¶
Index ¶
- Constants
- Variables
- type GenVarsConfig
- func (c *GenVarsConfig) Config() GenVarsConfig
- func (c *GenVarsConfig) EnvSubstEnabled() bool
- func (c *GenVarsConfig) KeySeparator() string
- func (c *GenVarsConfig) OutputPath() string
- func (c *GenVarsConfig) TokenSeparator() string
- func (c *GenVarsConfig) WithEnvSubst(enabled bool) *GenVarsConfig
- func (c *GenVarsConfig) WithKeySeparator(keySeparator string) *GenVarsConfig
- func (c *GenVarsConfig) WithOutputPath(out string) *GenVarsConfig
- func (c *GenVarsConfig) WithTokenSeparator(tokenSeparator string) *GenVarsConfig
- type ImplementationPrefix
- type ParsedTokenConfig
- func (t *ParsedTokenConfig) LookupKeys() 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) StripMetadata() string
- func (t *ParsedTokenConfig) StripPrefix() string
Constants ¶
const (
SELF_NAME = "configmanager"
)
Variables ¶
var ErrInvalidTokenPrefix = errors.New("token prefix has no implementation")
var ( // default varPrefix used by the replacer function // any token must beging with one of these else // it will be skipped as not a replaceable token VarPrefix = map[ImplementationPrefix]bool{ SecretMgrPrefix: true, ParamStorePrefix: true, AzKeyVaultSecretsPrefix: true, GcpSecretsPrefix: true, HashicorpVaultPrefix: true, AzTableStorePrefix: true, AzAppConfigPrefix: true, UnknownPrefix: true, } )
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 (*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) 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) WithEnvSubst ¶
func (c *GenVarsConfig) WithEnvSubst(enabled bool) *GenVarsConfig
WithKeySeparator adds a custom key separotor
func (*GenVarsConfig) WithKeySeparator ¶
func (c *GenVarsConfig) WithKeySeparator(keySeparator string) *GenVarsConfig
WithKeySeparator adds a custom key separotor
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 NewParsedTokenConfig ¶
func NewParsedTokenConfig(token string, config GenVarsConfig) (*ParsedTokenConfig, error)
NewParsedTokenConfig returns a pointer to a new TokenConfig struct returns nil if current prefix does not correspond to an Implementation
The caller needs to make sure it is not nil TODO: a custom parser would be best here
func (*ParsedTokenConfig) LookupKeys ¶
func (t *ParsedTokenConfig) LookupKeys() 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
Strip
returns the only the store indicator string without any of the configmanager token enrichment:
- 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) StripMetadata ¶
func (t *ParsedTokenConfig) StripMetadata() string
StripMetadata returns the fullToken without the metadata
func (*ParsedTokenConfig) StripPrefix ¶
func (t *ParsedTokenConfig) StripPrefix() string