secrets

package
v0.0.0-...-72c2bb7 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2020 License: MIT Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSSecrets

type AWSSecrets struct {
	Region string
	// contains filtered or unexported fields
}

AWSSecrets retrieves secrets from AWS Parameter Store

func NewAWSSecrets

func NewAWSSecrets(region string) *AWSSecrets

NewAWSSecrets returns an instance with optional region specified, otherwise uses us-east-1

func (*AWSSecrets) GetSecureParameter

func (s *AWSSecrets) GetSecureParameter(key string) ([]byte, error)

GetSecureParameter retrieves the parameter specified by key, or error otherwise.

func (*AWSSecrets) SetSecureParameter

func (s *AWSSecrets) SetSecureParameter(key, value string) error

func (*AWSSecrets) WithCredentials

func (s *AWSSecrets) WithCredentials(id, key string)

WithCredentials creates a session with credentials

type EnvSecrets

type EnvSecrets struct {
}

EnvSecrets retrieves secrets from environment variables

func NewEnvSecrets

func NewEnvSecrets() *EnvSecrets

NewEnvSecrets returns an instance

func (*EnvSecrets) GetSecureParameter

func (s *EnvSecrets) GetSecureParameter(key string) ([]byte, error)

GetSecureParameter retrieves the env variable specified by key, or error otherwise.

func (*EnvSecrets) SetSecureParameter

func (s *EnvSecrets) SetSecureParameter(key, value string) error

func (*EnvSecrets) WithCredentials

func (s *EnvSecrets) WithCredentials(id, key string)

WithCredentials not necessary for local testing

type Secrets

type Secrets interface {
	WithCredentials(id, key string)
	GetSecureParameter(key string) ([]byte, error)
	SetSecureParameter(key, value string) error
}

type SecretsCache

type SecretsCache struct {
	Region      string
	Environment string
	// contains filtered or unexported fields
}

SecretsCache for accessing cached/stored secrets

func NewSecretsCache

func NewSecretsCache(env, region string) *SecretsCache

NewSecretsCache returns an instance for acquiring the secrets from either local env vars or AWS

func (*SecretsCache) BigQueryCredentials

func (s *SecretsCache) BigQueryCredentials() (string, error)

func (*SecretsCache) DBString

func (s *SecretsCache) DBString(serviceKey string) (string, error)

DBString returns the database connection string for the environment and service

func (*SecretsCache) DNSAddresses

func (s *SecretsCache) DNSAddresses() ([]string, error)

func (*SecretsCache) DiscoveryAddr

func (s *SecretsCache) DiscoveryAddr() (string, error)

func (*SecretsCache) GetPortScanToken

func (s *SecretsCache) GetPortScanToken() (string, error)

func (*SecretsCache) GetSecureString

func (s *SecretsCache) GetSecureString(key string) (string, error)

GetSecureString allows caller to provide the full key to return a string value

func (*SecretsCache) ServicePassword

func (s *SecretsCache) ServicePassword(serviceKey string) (string, error)

ServicePassword retrieves the password for the initialized servicekey

func (*SecretsCache) SetSystemIDs

func (s *SecretsCache) SetSystemIDs(orgID, userID int) error

func (*SecretsCache) StateAddr

func (s *SecretsCache) StateAddr() (string, error)

func (*SecretsCache) StatePassword

func (s *SecretsCache) StatePassword() (string, error)

func (*SecretsCache) SystemOrgID

func (s *SecretsCache) SystemOrgID() (int, error)

func (*SecretsCache) SystemUserID

func (s *SecretsCache) SystemUserID() (int, error)

func (*SecretsCache) WebFilePath

func (s *SecretsCache) WebFilePath() (string, error)

func (*SecretsCache) WithCredentials

func (s *SecretsCache) WithCredentials(id, key string)

Jump to

Keyboard shortcuts

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