Secretkey should be SecretAccessKey

This commit is contained in:
Harshavardhana
2015-02-10 03:08:00 -08:00
parent 8ae3f13df8
commit 516631d388
3 changed files with 9 additions and 9 deletions
+3 -3
View File
@@ -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
+3 -3
View File
@@ -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)
+3 -3
View File
@@ -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
}