From 516631d3880ff7fcb23246fa66fe8a7f67d67f77 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Tue, 10 Feb 2015 03:08:00 -0800 Subject: [PATCH] Secretkey should be SecretAccessKey --- common.go | 6 +++--- pkg/s3/auth.go | 6 +++--- pkg/s3/client.go | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/common.go b/common.go index a73d4c93..670337d4 100644 --- a/common.go +++ b/common.go @@ -57,9 +57,9 @@ func getAWSEnvironment() (auth *s3.Auth, err error) { return nil, missingSecretErr } auth = &s3.Auth{ - AccessKey: accessKey, - SecretKey: secretKey, - Hostname: "s3.amazonaws.com", + AccessKey: accessKey, + SecretAccessKey: secretKey, + Hostname: "s3.amazonaws.com", } } else { var n int diff --git a/pkg/s3/auth.go b/pkg/s3/auth.go index bdd3db1c..cf322af4 100644 --- a/pkg/s3/auth.go +++ b/pkg/s3/auth.go @@ -37,8 +37,8 @@ import ( // See http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?RESTAuthentication.html type Auth struct { - AccessKey string - SecretKey string + AccessKey string + SecretAccessKey string // If empty, the standard US region of "s3.amazonaws.com" is used. Hostname string @@ -118,7 +118,7 @@ func (a *Auth) SignRequest(req *http.Request) { if date := req.Header.Get("Date"); date == "" { req.Header.Set("Date", time.Now().UTC().Format(http.TimeFormat)) } - hm := hmac.New(sha1.New, []byte(a.SecretKey)) + hm := hmac.New(sha1.New, []byte(a.SecretAccessKey)) ss := a.stringToSign(req) //log.Printf("String to sign: %q (%x)", ss, ss) io.WriteString(hm, ss) diff --git a/pkg/s3/client.go b/pkg/s3/client.go index ee668b52..d856e766 100644 --- a/pkg/s3/client.go +++ b/pkg/s3/client.go @@ -375,9 +375,9 @@ func (c *Client) Delete(bucket, key string) error { func NewAuth(accessKey, secretKey, hostname string) (auth *Auth) { auth = &Auth{ - AccessKey: accessKey, - SecretKey: secretKey, - Hostname: hostname} + AccessKey: accessKey, + SecretAccessKey: secretKey, + Hostname: hostname} return }