diff --git a/common.go b/common.go index 72142837..c41d0501 100644 --- a/common.go +++ b/common.go @@ -96,9 +96,9 @@ func getMinioEnvironment() (auth *minio.Auth, err error) { return nil, missingSecretErr } auth = &minio.Auth{ - AccessKey: accessKey, - SecretAccessKey: secretKey, - Hostname: "127.0.0.1:8080", + AccessKey: accessKey, + SecretKey: secretKey, + Hostname: "127.0.0.1:8080", } } else { var n int @@ -131,9 +131,9 @@ func getAWSEnvironment() (auth *s3.Auth, err error) { return nil, missingSecretErr } auth = &s3.Auth{ - AccessKey: accessKey, - SecretAccessKey: secretKey, - Hostname: "s3.amazonaws.com", + AccessKey: accessKey, + SecretKey: secretKey, + Hostname: "s3.amazonaws.com", } } else { var n int diff --git a/configure.go b/configure.go index ed251d90..5a085e4e 100644 --- a/configure.go +++ b/configure.go @@ -48,8 +48,8 @@ func doMinioConfigure(c *cli.Context) { } */ auth := &minio.Auth{ - // AccessKey: accessKey, - // SecretAccessKey: secretKey, + //AccessKey: accessKey, + //SecretKey: secretKey, Hostname: hostname, // CertPEM: certFile, // KeyPEM: keyFile, diff --git a/pkg/minio/auth.go b/pkg/minio/auth.go index 626e3f20..0b7ebe97 100644 --- a/pkg/minio/auth.go +++ b/pkg/minio/auth.go @@ -9,11 +9,11 @@ import ( ) type Auth struct { - AccessKey string - SecretAccessKey string - Hostname string - CertPEM string - KeyPEM string + AccessKey string + SecretKey string + Hostname string + CertPEM string + KeyPEM string } type TlsConfig struct { diff --git a/pkg/s3/auth.go b/pkg/s3/auth.go index 14776048..f543159b 100644 --- a/pkg/s3/auth.go +++ b/pkg/s3/auth.go @@ -34,8 +34,8 @@ import ( // See http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?RESTAuthentication.html type Auth struct { - AccessKey string - SecretAccessKey string + AccessKey string + SecretKey string // Hostname is the S3 hostname to use. // If empty, the standard US region of "s3.amazonaws.com" is @@ -61,7 +61,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.SecretAccessKey)) + hm := hmac.New(sha1.New, []byte(a.SecretKey)) ss := a.stringToSign(req) //log.Printf("String to sign: %q (%x)", ss, ss) io.WriteString(hm, ss) diff --git a/pkg/s3/auth_test.go b/pkg/s3/auth_test.go index 531667d1..da5b02ec 100644 --- a/pkg/s3/auth_test.go +++ b/pkg/s3/auth_test.go @@ -114,7 +114,7 @@ func TestBucketFromHostname(t *testing.T) { func TestSignRequest(t *testing.T) { r := req("GET /foo HTTP/1.1\n\n") - auth := &Auth{AccessKey: "key", SecretAccessKey: "secretkey"} + auth := &Auth{AccessKey: "key", SecretKey: "secretkey"} auth.SignRequest(r) if r.Header.Get("Date") == "" { t.Error("expected a Date set") diff --git a/pkg/s3/client.go b/pkg/s3/client.go index 741e8db9..a62937cd 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, - SecretAccessKey: secretKey, - Hostname: hostname} + AccessKey: accessKey, + SecretKey: secretKey, + Hostname: hostname} return }