generator

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2022 License: MIT Imports: 13 Imported by: 5

Documentation

Overview

*

  • Azure KeyVault implementation

*

Index

Constants

View Source
const (

	//
	// secretMgrPrefix  = "AWSSECRETS"
	// paramStorePrefix = "AWSPARAMSTR"
	SecretMgrPrefix  = "AWSSECRETS"
	ParamStorePrefix = "AWSPARAMSTR"
	AzKeyVaultPrefix = "AZKEYVAULT"
)

Variables

View Source
var (
	// default varPrefix
	VarPrefix = map[string]bool{SecretMgrPrefix: true, ParamStorePrefix: true}
)

Functions

This section is empty.

Types

type DefaultStrategy

type DefaultStrategy struct {
}

func NewDefatultStrategy

func NewDefatultStrategy() *DefaultStrategy

type GenVars

type GenVars struct {
	Generatoriface
	// contains filtered or unexported fields
}

func NewGenerator

func NewGenerator() *GenVars

NewGenerator returns a new instance

func (*GenVars) ConvertToExportVar

func (c *GenVars) ConvertToExportVar()

ConvertToExportVar assigns the k/v out as unix style export key=val pairs seperated by `\n`

func (*GenVars) FlushToFile

func (c *GenVars) FlushToFile() (string, error)

FlushToFile saves contents to file provided in the config input into the generator

func (*GenVars) Generate

func (c *GenVars) Generate(tokens []string) (ParsedMap, error)

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) GenerateFromCmd

func (gv *GenVars) GenerateFromCmd(tokens []string) error

GenerateFromTokens is a helper cmd method to call from retrieveCmd

func (*GenVars) UploadTokensWithVals

func (gv *GenVars) UploadTokensWithVals(tokens map[string]string) error

UploadTokensWithVals takes in a map of key/value pairs and uploads them

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 NewConfig

func NewConfig() *GenVarsConfig

NewConfig

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 Generatoriface

type Generatoriface interface {
	Generate(tokens []string) (ParsedMap, error)
	ConvertToExportVar()
	FlushToFile() (string, error)
}

type KvStore

type KvStore struct {
	// contains filtered or unexported fields
}

func NewKvStore

func NewKvStore(ctx context.Context) (*KvStore, error)

NewKvStore returns a KvStore requires `AZURE_SUBSCRIPTION_ID` environment variable to be present to successfuly work

func NewKvStoreWithToken

func NewKvStoreWithToken(ctx context.Context, token, tokenSeparator, keySeparator string) (*KvStore, error)

NewKvStore returns a KvStore requires `AZURE_SUBSCRIPTION_ID` environment variable to be present to successfuly work

type ParamStore

type ParamStore struct {
	// contains filtered or unexported fields
}

func NewParamStore

func NewParamStore(ctx context.Context) (*ParamStore, error)

type ParsedMap

type ParsedMap map[string]any

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)

Jump to

Keyboard shortcuts

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