credstash

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package credstash implements backend for Credstash (that uses AWS KMS and DynamoDB) Heavily inspired in github.com/ouzi-dev/credstash-operator using https://github.com/versent/unicreds

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBackend

func NewBackend() backend.Backend

NewBackend returns an uninitialized Backend for Credstash

Types

type Backend

type Backend struct {
	SecretsManager SecretManagerClientProvider
	// contains filtered or unexported fields
}

Backend represents a backend for Credstash

func (*Backend) Get

func (s *Backend) Get(key string, version string) (string, error)

Get retrieves the secret associated with key from Credstash

func (*Backend) Init

func (s *Backend) Init(parameters map[string]interface{}, credentials []byte) error

Init initializes the Backend for Credstash

type SecretManagerClient

type SecretManagerClient struct {
}

SecretManagerClient defining this struct to write methods for it

func (SecretManagerClient) GetHighestVersionSecret

func (s SecretManagerClient) GetHighestVersionSecret(tableName *string, name string, encContext *unicreds.EncryptionContextValue) (*unicreds.DecryptedCredential, error)

GetHighestVersionSecret gets a secret with latest version from credstash

func (SecretManagerClient) GetSecret

func (s SecretManagerClient) GetSecret(tableName *string, name string, version string, encContext *unicreds.EncryptionContextValue) (*unicreds.DecryptedCredential, error)

GetSecret gets a secret with specific version from credstash

func (SecretManagerClient) SetDynamoDBConfig

func (s SecretManagerClient) SetDynamoDBConfig(config *aws.Config)

SetDynamoDBConfig sets configuration for DynamoDB access

func (SecretManagerClient) SetKMSConfig

func (s SecretManagerClient) SetKMSConfig(config *aws.Config)

SetKMSConfig sets configuration for KMS access

type SecretManagerClientProvider

type SecretManagerClientProvider interface {
	SetKMSConfig(config *aws.Config)
	SetDynamoDBConfig(config *aws.Config)
	GetHighestVersionSecret(tableName *string, name string, encContext *unicreds.EncryptionContextValue) (*unicreds.DecryptedCredential, error)
	GetSecret(tableName *string, name string, version string, encContext *unicreds.EncryptionContextValue) (*unicreds.DecryptedCredential, error)
}

SecretManagerClientProvider will be our unicreds client

Jump to

Keyboard shortcuts

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