update name change

This commit is contained in:
Ryan Kohler 2021-01-25 12:05:44 -08:00
parent 88fab8941c
commit 8cdc6a9ad0
1 changed files with 9 additions and 9 deletions

View File

@ -26,17 +26,17 @@ type awsRequestSigner struct {
}
const (
// AWS Signature Version 4 signing algorithm identifier.
// AWS Signature Version 4 signing algorithm identifier.
awsAlgorithm = "AWS4-HMAC-SHA256"
// The termination string for the AWS credential scope value as defined in
// https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html
// The termination string for the AWS credential scope value as defined in
// https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html
awsRequestType = "aws4_request"
// The AWS authorization header name for the security session token if available.
// The AWS authorization header name for the security session token if available.
awsSecurityTokenHeader = "x-amz-security-token"
// The AWS authorization header name for the auto-generated date.
// The AWS authorization header name for the auto-generated date.
awsDateHeader = "x-amz-date"
awsTimeFormatLong = "20060102T150405Z"
@ -203,14 +203,14 @@ func (rs *awsRequestSigner) generateAuthentication(req *http.Request, timestamp
serviceName = splitHost[0]
}
credentialScope := fmt.Sprintf("%s/%s/%s/%s", dateStamp, rs.RegionName, serviceName, awsRequestType)
credentialScope := fmt.Sprintf("%s/%s/%s/%s",dateStamp, rs.RegionName, serviceName, awsRequestType)
requestString, err := canonicalRequest(req, canonicalHeaderColumns, canonicalHeaderData)
if err != nil {
return "", err
}
requestHash, err := getSha256([]byte(requestString))
if err != nil {
if err != nil{
return "", err
}
@ -221,7 +221,7 @@ func (rs *awsRequestSigner) generateAuthentication(req *http.Request, timestamp
dateStamp, rs.RegionName, serviceName, awsRequestType, stringToSign,
} {
signingKey, err = getHmacSha256(signingKey, []byte(signingInput))
if err != nil {
if err != nil{
return "", err
}
}