Documentation
¶
Overview ¶
*
- Azure KeyVault implementation
*
Index ¶
- Variables
- type DefaultStrategy
- type GcpSecrets
- type GenVars
- func (c *GenVars) Config() *GenVarsConfig
- func (c *GenVars) ConfigOutputPath() string
- func (c *GenVars) ConvertToExportVar() []string
- func (c *GenVars) FlushToFile(w io.Writer, out []string) error
- func (c *GenVars) Generate(tokens []string) (ParsedMap, error)
- func (c *GenVars) StrToFile(w io.Writer, str string) error
- func (c *GenVars) WithConfig(cfg *GenVarsConfig) *GenVars
- func (c *GenVars) WithContext(ctx context.Context) *GenVars
- type GenVarsConfig
- type GenVarsiface
- type Generatoriface
- type ImplementationPrefix
- type KvScrtStore
- type ParamStore
- type ParsedMap
- type SecretsMgr
- type VaultStore
Constants ¶
This section is empty.
Variables ¶
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, HashicorpVaultPrefix: true} )
Functions ¶
This section is empty.
Types ¶
type DefaultStrategy ¶
type DefaultStrategy struct {
}
func NewDefatultStrategy ¶
func NewDefatultStrategy() *DefaultStrategy
type GcpSecrets ¶ added in v1.15.0
type GcpSecrets struct {
// contains filtered or unexported fields
}
func NewGcpSecrets ¶ added in v1.15.0
func NewGcpSecrets(ctx context.Context) (*GcpSecrets, error)
type GenVars ¶
type GenVars struct {
Generatoriface
// contains filtered or unexported fields
}
GenVars is the main struct holding the strategy patterns iface any initialised config if overridded with withers as well as the final outString and the initial rawMap which wil be passed in a loop into a goroutine to perform the relevant strategy network calls to the config store implementations
func NewGenerator ¶
func NewGenerator() *GenVars
NewGenerator returns a new instance of Generator with a default strategy pattern wil be overwritten during the first run of a found tokens map
func (*GenVars) Config ¶ added in v1.3.0
func (c *GenVars) Config() *GenVarsConfig
Config gets Config on the GenVars
func (*GenVars) ConfigOutputPath ¶ added in v1.4.2
ConfigOutputPath returns the output path set on GenVars create withconfig or default value
func (*GenVars) ConvertToExportVar ¶
ConvertToExportVar assigns the k/v out as unix style export key=val pairs separated by `\n`
func (*GenVars) FlushToFile ¶
FlushToFile saves contents to file provided in the config input into the generator default location is ./app.env
func (*GenVars) Generate ¶
Generate generates a k/v map of the tokens with their corresponding secret/paramstore values the standard pattern of a token should follow a path like
func (*GenVars) WithConfig ¶
func (c *GenVars) WithConfig(cfg *GenVarsConfig) *GenVars
WithConfig uses custom config
type GenVarsConfig ¶
type GenVarsConfig struct {
// contains filtered or unexported fields
}
GenVarsConfig defines the input config object to be passed
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 GenVarsiface ¶ added in v1.6.0
type GenVarsiface interface {
Generatoriface
Config() *GenVarsConfig
ConfigOutputPath() string
}
GenVarsiface stores strategy and GenVars implementation behaviour
type Generatoriface ¶
type Generatoriface interface {
Generate(tokens []string) (ParsedMap, error)
ConvertToExportVar() []string
FlushToFile(w io.Writer, outString []string) error
StrToFile(w io.Writer, str string) error
}
Generatoriface describes the exported methods on the GenVars struct.
type ImplementationPrefix ¶ added in v1.14.0
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" // Hashicorp Vault prefix HashicorpVaultPrefix ImplementationPrefix = "VAULT" // GcpSecrets GcpSecretsPrefix ImplementationPrefix = "GCPSECRETS" )
type KvScrtStore ¶ added in v1.2.0
type KvScrtStore struct {
// contains filtered or unexported fields
}
func NewKvScrtStore ¶ added in v1.2.0
func NewKvScrtStore(ctx context.Context, token, tokenSeparator, keySeparator string) (*KvScrtStore, error)
NewKvScrtStore returns a KvScrtStore requires `AZURE_SUBSCRIPTION_ID` environment variable to be present to successfully work
type ParamStore ¶
type ParamStore struct {
// contains filtered or unexported fields
}
func NewParamStore ¶
func NewParamStore(ctx context.Context) (*ParamStore, error)
type ParsedMap ¶
ParsedMap is the internal working object definition and the return type if results are not flushed to file
type SecretsMgr ¶
type SecretsMgr struct {
// contains filtered or unexported fields
}
func NewSecretsMgr ¶
func NewSecretsMgr(ctx context.Context) (*SecretsMgr, error)
type VaultStore ¶ added in v1.14.0
type VaultStore struct {
// contains filtered or unexported fields
}
func NewVaultStore ¶ added in v1.14.0
func NewVaultStore(ctx context.Context, token, tokenSeparator, keySeparator string) (*VaultStore, error)