aws

package
v0.0.0-...-8a41e16 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Abstracts the details of talking to the ECR API to facilitate testing

Index

Constants

This section is empty.

Variables

View Source
var (
	TEST_REGISTRY  = "123456789012.dkr.ecr.eu-west-1.amazonaws.com"
	TEST_USER      = "jdoe"
	TEST_PASSWORD  = "pasword123"
	TEST_EXPIRY    = "2023-01-01T12:00:00Z"
	TEST_AUTH_DATA = b64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%s:%s", TEST_USER, TEST_PASSWORD)))
	VALID_LIFETIME = "12h0m0s"
	TEST_NOW       = clock.MustParseTime(TEST_EXPIRY).Add(-clock.MustParseDuration(VALID_LIFETIME))
)

Functions

This section is empty.

Types

type ConcreteECRAuthentication

type ConcreteECRAuthentication struct {
	Session *session.Session
}

func (*ConcreteECRAuthentication) GetAuthorizationToken

func (a *ConcreteECRAuthentication) GetAuthorizationToken() (*ecr.AuthorizationData, error)

func (*ConcreteECRAuthentication) SetCredentials

func (a *ConcreteECRAuthentication) SetCredentials(creds *Credentials, region string) error

type Credentials

type Credentials struct {
	AccessKeyID     string
	SecretAccessKey string
}

type ECRAuthentication

type ECRAuthentication interface {
	GetAuthorizationToken() (*ecr.AuthorizationData, error)
	SetCredentials(creds *Credentials, region string) error
}

func NewECRAuthentication

func NewECRAuthentication() ECRAuthentication

func NewMockAuthentication

func NewMockAuthentication() ECRAuthentication

type MockECRAuthentication

type MockECRAuthentication struct{}

func (*MockECRAuthentication) GetAuthorizationToken

func (m *MockECRAuthentication) GetAuthorizationToken() (*ecr.AuthorizationData, error)

func (*MockECRAuthentication) SetCredentials

func (m *MockECRAuthentication) SetCredentials(creds *Credentials, region string) error

Jump to

Keyboard shortcuts

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