asm

package
v0.0.0-...-c3cf0e8 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultRegion = "eu-west-1"
View Source
const MockSecretValue string = "@MY_SECRET_VALUE@"

MockSecretValue is a dummy value for the mocks

View Source
const SMPatern = "arn:aws:secretsmanager:"

Variables

This section is empty.

Functions

func NewAPI

NewAPI returns a new concrete AWS SM client

func NewAPIForRegion

func NewAPIForRegion(region string) secretsmanageriface.SecretsManagerAPI

NewAPIForRegion returns a new concrete AWS SM client for a specific region

func NewFromRegion

func NewFromRegion(region string) client.ConfigProvider

NewFromRegion returns a session given a region

func NewFromRegionAndProfile

func NewFromRegionAndProfile(region string, awsProfile string) (client.ConfigProvider, error)

NewFromRegionAndProfile returns a session given a region and aws profile

func NewSession

func NewSession() client.ConfigProvider

New returns a new default session

Types

type Client

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

Client is a SM custom client

func NewClient

NewClient returns a new Client from an AWS SM client

func (*Client) ExtractPath

func (c *Client) ExtractPath(key string) (out string)

func (*Client) ExtractRegion

func (c *Client) ExtractRegion(key string) (region string)

func (*Client) GetSecret

func (c *Client) GetSecret(key string) (secret string, err error)

GetSecret return a Secret fetched from SM

func (*Client) IsSecret

func (c *Client) IsSecret(key string) bool

func (*Client) WithRegion

func (c *Client) WithRegion(region string)

Overrides region

type MockClient

type MockClient struct {
	secretsmanageriface.SecretsManagerAPI
	GetSecretShouldFail      bool
	DescribeSecretShouldFail bool
	ShouldBeEmpty            bool
	SecretValue              string
}

MockClient is an AWS secretsmanager client mock

func (*MockClient) DescribeSecret

DescribeSecret is a mock implementation of the sm method

func (*MockClient) GetSecretValue

GetSecretValue is a mock implementation of secretsmanager method

Jump to

Keyboard shortcuts

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