Documentation ¶
Index ¶
- func CreateCanonicalRequest(amzdate string, token, signedHeaders, payloadHash string) string
- func CreateStringToSign(datestamp string, amzDate string, cannonicalRequest string) string
- func GetAmzDate(t time.Time) string
- func GetAuthenticationRequest(accessKey string, secretAccessKey string, token string, dateTime time.Time) (string, error)
- func GetAuthenticationRequestNow(accessKey string, secretAccessKey string, token string) (string, error)
- func GetDate(t time.Time) string
- func SHA256Hash(input string) string
- type Credential
- type Resource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCanonicalRequest ¶
CreateCanonicalRequest returns the canonical request including signed headers from AWS STS
func CreateStringToSign ¶
CreateStringToSign returns the string for AWS STS to sign
func GetAmzDate ¶
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 SHA256Hash ¶
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.