Merge pull request #33 from harshavardhana/pr_out_rename_secretaccess_to_secret_to_be_more_appropriate
This commit is contained in:
@@ -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
|
||||
|
||||
+2
-2
@@ -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,
|
||||
|
||||
+5
-5
@@ -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 {
|
||||
|
||||
+3
-3
@@ -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)
|
||||
|
||||
+1
-1
@@ -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")
|
||||
|
||||
+3
-3
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user