aws

package
v1.0.2-release Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCanonicalRequest

func CreateCanonicalRequest(amzdate string, token, signedHeaders, payloadHash string) string

CreateCanonicalRequest returns the canonical request including signed headers from AWS STS

func CreateStringToSign

func CreateStringToSign(datestamp string, amzDate string, cannonicalRequest string) string

CreateStringToSign returns the string for AWS STS to sign

func GetAmzDate

func GetAmzDate(t time.Time) string

GetAmzDate returns the date in the format of yyyyMMdd'T'HHmmss'Z'

func GetAuthenticationRequest

func GetAuthenticationRequest(accessKey string, secretAccessKey string, token string, dateTime time.Time) (string, error)

GetAuthenticationRequest returns the signed request for AWS STS

func GetAuthenticationRequestNow

func GetAuthenticationRequestNow(accessKey string, secretAccessKey string, token string) (string, error)

GetAuthenticationRequestNow returns the signed request for AWS STS using the current time

func GetDate

func GetDate(t time.Time) string

GetDate returns the date in the format of yyyyMMdd

func SHA256Hash

func SHA256Hash(input string) string

SHA256Hash returns the SHA256 hash of the input string

Types

type Credential

type Credential struct {
	AccessKeyID     string `json:"AccessKeyId"`
	SecretAccessKey string `json:"SecretAccessKey"`
	Token           string `json:"Token"`
}

Credential is a struct that holds the AWS credentials

type Resource

type Resource interface {
	Name() string
	GetCredential() (Credential, error)
}

Resource is used to retrieve the IAM credential. This is required since how an AWS Resource gets an IAM credential depending on its type.AwsResource For example lambda gets these credentials via environment variables, while EC2 gets it from a static metadata URL and ECS gets it from a dynamic URL.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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