aws

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetSecretID

type GetSecretID = func(env string, keyType string, keyID string, requiredPrivateKeys map[string]bool,
	requiredPublicKeys map[string]bool) (string, error)

GetSecretID function construct SecretId in aws secrets manager based on: ENV (prod, dev etc), keyID (service identifier), keyType (PrivateKey/PublicKey/Algorithm) It's possible to skip PrivateKey/PublicKey for certain keyIDs, just pass map with keyID you want to skip.

type GetSecretValue

type GetSecretValue = func(keyType string, value []byte, secret *httpsignatures.Secret) error

GetSecretValue function convert value from secrets manager to Secret

type SecretsManagerStorage

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

SecretsManagerStorage AWS Secrets Manager storage

func NewAwsSecretsManagerStorage

func NewAwsSecretsManagerStorage(env string, sm secretsmanageriface.SecretsManagerAPI) *SecretsManagerStorage

NewAwsSecretsManagerStorage create storage

func (SecretsManagerStorage) Get

func (s SecretsManagerStorage) Get(keyID string) (httpsignatures.Secret, error)

Get get secret from cache by KeyID or from AWS Secrets Manager for first time

func (*SecretsManagerStorage) SetAlgorithm

func (s *SecretsManagerStorage) SetAlgorithm(a string)

SetAlgorithm set static algorithm for all keys. This allow not to store algorithm in AWS Secrets Manager.

func (*SecretsManagerStorage) SetCacheExpiresSeconds

func (s *SecretsManagerStorage) SetCacheExpiresSeconds(e uint32)

SetCacheExpiresSeconds set default cache expires seconds.

func (*SecretsManagerStorage) SetGetSecretIDFunc

func (s *SecretsManagerStorage) SetGetSecretIDFunc(f GetSecretID)

SetGetSecretIDFunc set custom function to build secret ID in AWS SecretsManager.

func (*SecretsManagerStorage) SetGetSecretValueFunc

func (s *SecretsManagerStorage) SetGetSecretValueFunc(f GetSecretValue)

SetGetSecretValueFunc set custom function to extract value from secret.

func (*SecretsManagerStorage) SetRequiredPrivateKeys

func (s *SecretsManagerStorage) SetRequiredPrivateKeys(l map[string]bool)

SetRequiredPrivateKeys set keys with required PrivateKey secrets.

func (*SecretsManagerStorage) SetRequiredPublicKeys

func (s *SecretsManagerStorage) SetRequiredPublicKeys(l map[string]bool)

SetRequiredPublicKeys set keys with required PublicKey secrets.

Jump to

Keyboard shortcuts

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