Documentation ¶
Index ¶
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func CertsCert_filesDcidevpublicPem() (*asset, error)
- func CertsCert_filesDcidevpublicPemBytes() ([]byte, error)
- func CertsCert_filesDcipublicPem() (*asset, error)
- func CertsCert_filesDcipublicPemBytes() ([]byte, error)
- func CreateHTTPClient(insecure bool, address string, env string, scan bool) (client *http.Client, err error)
- func CreateHTTPClientAllowNonLocal(insecure bool, address string, env string, scan bool, allowNonLocal bool) (client *http.Client, err error)
- func IsUrlIp(address string) (bool, error)
- func MustAsset(name string) []byte
- func PreCheckEnvironment(environment string) (string, string, bool, error)
- func PruneCache(env string, addr string, limit uint64)
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- type Modifier
- func (m *Modifier) AdjustValue(path string, data map[string]interface{}, n int, logger *log.Logger) ([]string, error)
- func (m *Modifier) CleanCache(limit uint64)
- func (m *Modifier) Close()
- func (m *Modifier) Exists(path string) bool
- func (m *Modifier) FindIndexForService(project string, service string, logger *log.Logger) (string, error)
- func (m *Modifier) GetProjectServicesMap(logger *log.Logger) (map[string][]string, error)
- func (m *Modifier) GetTemplateFilePaths(pathName string, logger *log.Logger) ([]string, error)
- func (m *Modifier) GetVersionValues(mod *Modifier, wantCerts bool, enginePath string, logger *log.Logger) (map[string]map[string]interface{}, error)
- func (m *Modifier) HardDelete(path string, logger *log.Logger) (map[string]interface{}, error)
- func (m *Modifier) List(path string, logger *log.Logger) (*api.Secret, error)
- func (m *Modifier) ListEnv(path string, logger *log.Logger) (*api.Secret, error)
- func (m *Modifier) ListSubsection(sectionKey string, project string, indexName string, logger *log.Logger) ([]string, error)
- func (m *Modifier) ReadData(path string) (map[string]interface{}, error)
- func (m *Modifier) ReadMapValue(valueMap map[string]interface{}, path string, key string) (string, error)
- func (m *Modifier) ReadMetadata(path string, logger *log.Logger) (map[string]interface{}, error)
- func (m *Modifier) ReadValue(path string, key string) (string, error)
- func (m *Modifier) ReadVersionMetadata(path string, logger *log.Logger) (map[string]interface{}, error)
- func (m *Modifier) Release()
- func (m *Modifier) RemoveFromCache()
- func (m *Modifier) SoftDelete(path string, logger *log.Logger) (map[string]interface{}, error)
- func (m *Modifier) ValidateEnvironment(environment string, init bool, policySuffix string, logger *log.Logger) (bool, string, error)
- func (m *Modifier) Write(path string, data map[string]interface{}, logger *log.Logger) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func CertsCert_filesDcidevpublicPem ¶
func CertsCert_filesDcidevpublicPem() (*asset, error)
func CertsCert_filesDcipublicPem ¶
func CertsCert_filesDcipublicPem() (*asset, error)
func CreateHTTPClient ¶
func CreateHTTPClient(insecure bool, address string, env string, scan bool) (client *http.Client, err error)
CreateHTTPClient reads from several .pem files to get the necessary keys and certs to configure the http client and returns the client.
func CreateHTTPClientAllowNonLocal ¶
func CreateHTTPClientAllowNonLocal(insecure bool, address string, env string, scan bool, allowNonLocal bool) (client *http.Client, err error)
CreateHTTPClient reads from several .pem files to get the necessary keys and certs to configure the http client and returns the client.
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func PreCheckEnvironment ¶
PreCheckEnvironment Returns: env, parts, true if parts is path, false if part of file name, error
func PruneCache ¶
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
Types ¶
type Modifier ¶
type Modifier struct { Insecure bool // Indicates if connections to vault should be secure Direct bool // Bypass vault and utilize alternative source when possible. SecretDictionary *api.Secret // Current Secret Dictionary Cache -- populated by mod.List("templates" Env string // Environment (local/dev/QA; Initialized to secrets) RawEnv string Regions []string // Supported regions Version string // Version for data VersionFilter []string // Used to filter vault paths TemplatePath string // Path to template we are processing. ProjectIndex []string // Which projects are indexed. SectionKey string // The section key: Index or Restricted. SectionName string // The name of the actual section. SubSectionName string // The name of the actual subsection. SubSectionValue string // The actual value for the sub section. SectionPath string // The path to the Index (both seed and vault) // contains filtered or unexported fields }
Modifier maintains references to the active client and respective logical needed to write to the vault. Path can be changed to alter where in the vault the key,value pair is stored
func NewModifier ¶
func NewModifier(insecure bool, token string, address string, env string, regions []string, useCache bool, logger *log.Logger) (*Modifier, error)
NewModifier Constructs a new modifier struct and connects to the vault @param token The access token needed to connect to the vault @param address The address of the API endpoint for the server @param env The environment currently connecting to. @param regions Regions we want @param useCache Whether to use the modcache or not. @return A pointer to the newly contstructed modifier object (Note: path set to default),
Any errors generated in creating the client
func (*Modifier) AdjustValue ¶
func (m *Modifier) AdjustValue(path string, data map[string]interface{}, n int, logger *log.Logger) ([]string, error)
AdjustValue adjusts the value at the given path/key by n
func (*Modifier) CleanCache ¶
func (*Modifier) FindIndexForService ¶
func (m *Modifier) FindIndexForService(project string, service string, logger *log.Logger) (string, error)
Given Project and Service, looks for a key index and returns it.
func (*Modifier) GetProjectServicesMap ¶
GetProjectServiceMap - returns a map of all projects with list of their available services.
func (*Modifier) GetTemplateFilePaths ¶
func (*Modifier) GetVersionValues ¶
func (m *Modifier) GetVersionValues(mod *Modifier, wantCerts bool, enginePath string, logger *log.Logger) (map[string]map[string]interface{}, error)
GetVersionValues gets filepath for values and grabs metadata for those paths.
func (*Modifier) HardDelete ¶
func (*Modifier) ListSubsection ¶
func (*Modifier) ReadData ¶
ReadData Reads the most recent data from the path referenced by this Modifier @return A Secret pointer that contains key,value pairs and metadata
errors generated from reading
func (*Modifier) ReadMapValue ¶
func (m *Modifier) ReadMapValue(valueMap map[string]interface{}, path string, key string) (string, error)
ReadMapValue takes a valueMap, path, and a key and returns the corresponding value from the vault
func (*Modifier) ReadMetadata ¶
ReadMetadata Reads the Metadata from the path referenced by this Modifier @return A Secret pointer that contains key,value pairs and metadata
errors generated from reading
func (*Modifier) ReadValue ¶
ReadValue takes a path and a key and returns the corresponding value from the vault
func (*Modifier) ReadVersionMetadata ¶
func (m *Modifier) ReadVersionMetadata(path string, logger *log.Logger) (map[string]interface{}, error)
ReadVersionMetadata Reads the Metadata of all versions from the path referenced by this Modifier
func (*Modifier) RemoveFromCache ¶
func (m *Modifier) RemoveFromCache()
func (*Modifier) SoftDelete ¶
func (*Modifier) ValidateEnvironment ¶
func (m *Modifier) ValidateEnvironment(environment string, init bool, policySuffix string, logger *log.Logger) (bool, string, error)
ValidateEnvironment Ensures token has access to requested data.
func (*Modifier) Write ¶
func (m *Modifier) Write(path string, data map[string]interface{}, logger *log.Logger) ([]string, error)
Writes the key,value pairs in data to the vault
@param data A set of key,value pairs to be written
@return Warnings (if any) generated from the vault,
errors generated by writing