summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/minio/minio-go/pkg/credentials
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2018-04-16 05:37:14 -0700
committerJoram Wilander <jwawilander@gmail.com>2018-04-16 08:37:14 -0400
commit6e2cb00008cbf09e556b00f87603797fcaa47e09 (patch)
tree3c0eb55ff4226a3f024aad373140d1fb860a6404 /vendor/github.com/minio/minio-go/pkg/credentials
parentbf24f51c4e1cc6286885460672f7f449e8c6f5ef (diff)
downloadchat-6e2cb00008cbf09e556b00f87603797fcaa47e09.tar.gz
chat-6e2cb00008cbf09e556b00f87603797fcaa47e09.tar.bz2
chat-6e2cb00008cbf09e556b00f87603797fcaa47e09.zip
Depenancy upgrades and movign to dep. (#8630)
Diffstat (limited to 'vendor/github.com/minio/minio-go/pkg/credentials')
-rw-r--r--vendor/github.com/minio/minio-go/pkg/credentials/chain_test.go144
-rw-r--r--vendor/github.com/minio/minio-go/pkg/credentials/credentials_test.go73
-rw-r--r--vendor/github.com/minio/minio-go/pkg/credentials/env_test.go105
-rw-r--r--vendor/github.com/minio/minio-go/pkg/credentials/file_test.go189
-rw-r--r--vendor/github.com/minio/minio-go/pkg/credentials/iam_aws_test.go197
-rw-r--r--vendor/github.com/minio/minio-go/pkg/credentials/static_test.go68
6 files changed, 0 insertions, 776 deletions
diff --git a/vendor/github.com/minio/minio-go/pkg/credentials/chain_test.go b/vendor/github.com/minio/minio-go/pkg/credentials/chain_test.go
deleted file mode 100644
index d26e376ff..000000000
--- a/vendor/github.com/minio/minio-go/pkg/credentials/chain_test.go
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Minio Go Library for Amazon S3 Compatible Cloud Storage
- * Copyright 2017 Minio, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package credentials
-
-import (
- "errors"
- "testing"
-)
-
-type testCredProvider struct {
- creds Value
- expired bool
- err error
-}
-
-func (s *testCredProvider) Retrieve() (Value, error) {
- s.expired = false
- return s.creds, s.err
-}
-func (s *testCredProvider) IsExpired() bool {
- return s.expired
-}
-
-func TestChainGet(t *testing.T) {
- p := &Chain{
- Providers: []Provider{
- &credProvider{err: errors.New("FirstError")},
- &credProvider{err: errors.New("SecondError")},
- &testCredProvider{
- creds: Value{
- AccessKeyID: "AKIF",
- SecretAccessKey: "NOSECRET",
- SessionToken: "",
- },
- },
- &credProvider{
- creds: Value{
- AccessKeyID: "AKID",
- SecretAccessKey: "SECRET",
- SessionToken: "",
- },
- },
- },
- }
-
- creds, err := p.Retrieve()
- if err != nil {
- t.Fatal(err)
- }
-
- // Also check credentials
- if creds.AccessKeyID != "AKIF" {
- t.Fatalf("Expected 'AKIF', got %s", creds.AccessKeyID)
- }
- if creds.SecretAccessKey != "NOSECRET" {
- t.Fatalf("Expected 'NOSECRET', got %s", creds.SecretAccessKey)
- }
- if creds.SessionToken != "" {
- t.Fatalf("Expected empty token, got %s", creds.SessionToken)
- }
-}
-
-func TestChainIsExpired(t *testing.T) {
- credProvider := &credProvider{
- creds: Value{
- AccessKeyID: "UXHW",
- SecretAccessKey: "MYSECRET",
- SessionToken: "",
- },
- expired: true,
- }
- p := &Chain{
- Providers: []Provider{
- credProvider,
- },
- }
-
- if !p.IsExpired() {
- t.Fatal("Expected expired to be true before any Retrieve")
- }
-
- _, err := p.Retrieve()
- if err != nil {
- t.Fatal(err)
- }
-
- if p.IsExpired() {
- t.Fatal("Expected to be not expired after Retrieve")
- }
-}
-
-func TestChainWithNoProvider(t *testing.T) {
- p := &Chain{
- Providers: []Provider{},
- }
- if !p.IsExpired() {
- t.Fatal("Expected to be expired with no providers")
- }
- _, err := p.Retrieve()
- if err != nil {
- if err.Error() != "No valid providers found []" {
- t.Error(err)
- }
- }
-}
-
-func TestChainProviderWithNoValidProvider(t *testing.T) {
- errs := []error{
- errors.New("FirstError"),
- errors.New("SecondError"),
- }
- p := &Chain{
- Providers: []Provider{
- &credProvider{err: errs[0]},
- &credProvider{err: errs[1]},
- },
- }
-
- if !p.IsExpired() {
- t.Fatal("Expected to be expired with no providers")
- }
-
- _, err := p.Retrieve()
- if err != nil {
- if err.Error() != "No valid providers found [FirstError SecondError]" {
- t.Error(err)
- }
- }
-}
diff --git a/vendor/github.com/minio/minio-go/pkg/credentials/credentials_test.go b/vendor/github.com/minio/minio-go/pkg/credentials/credentials_test.go
deleted file mode 100644
index 92c77c4cb..000000000
--- a/vendor/github.com/minio/minio-go/pkg/credentials/credentials_test.go
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Minio Go Library for Amazon S3 Compatible Cloud Storage
- * Copyright 2017 Minio, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package credentials
-
-import (
- "errors"
- "testing"
-)
-
-type credProvider struct {
- creds Value
- expired bool
- err error
-}
-
-func (s *credProvider) Retrieve() (Value, error) {
- s.expired = false
- return s.creds, s.err
-}
-func (s *credProvider) IsExpired() bool {
- return s.expired
-}
-
-func TestCredentialsGet(t *testing.T) {
- c := New(&credProvider{
- creds: Value{
- AccessKeyID: "UXHW",
- SecretAccessKey: "MYSECRET",
- SessionToken: "",
- },
- expired: true,
- })
-
- creds, err := c.Get()
- if err != nil {
- t.Fatal(err)
- }
- if "UXHW" != creds.AccessKeyID {
- t.Errorf("Expected \"UXHW\", got %s", creds.AccessKeyID)
- }
- if "MYSECRET" != creds.SecretAccessKey {
- t.Errorf("Expected \"MYSECRET\", got %s", creds.SecretAccessKey)
- }
- if creds.SessionToken != "" {
- t.Errorf("Expected session token to be empty, got %s", creds.SessionToken)
- }
-}
-
-func TestCredentialsGetWithError(t *testing.T) {
- c := New(&credProvider{err: errors.New("Custom error")})
-
- _, err := c.Get()
- if err != nil {
- if err.Error() != "Custom error" {
- t.Errorf("Expected \"Custom error\", got %s", err.Error())
- }
- }
-}
diff --git a/vendor/github.com/minio/minio-go/pkg/credentials/env_test.go b/vendor/github.com/minio/minio-go/pkg/credentials/env_test.go
deleted file mode 100644
index 09cd77f7a..000000000
--- a/vendor/github.com/minio/minio-go/pkg/credentials/env_test.go
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Minio Go Library for Amazon S3 Compatible Cloud Storage
- * Copyright 2017 Minio, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package credentials
-
-import (
- "os"
- "reflect"
- "testing"
-)
-
-func TestEnvAWSRetrieve(t *testing.T) {
- os.Clearenv()
- os.Setenv("AWS_ACCESS_KEY_ID", "access")
- os.Setenv("AWS_SECRET_ACCESS_KEY", "secret")
- os.Setenv("AWS_SESSION_TOKEN", "token")
-
- e := EnvAWS{}
- if !e.IsExpired() {
- t.Error("Expect creds to be expired before retrieve.")
- }
-
- creds, err := e.Retrieve()
- if err != nil {
- t.Fatal(err)
- }
-
- expectedCreds := Value{
- AccessKeyID: "access",
- SecretAccessKey: "secret",
- SessionToken: "token",
- SignerType: SignatureV4,
- }
- if !reflect.DeepEqual(creds, expectedCreds) {
- t.Errorf("Expected %v, got %v", expectedCreds, creds)
- }
-
- if e.IsExpired() {
- t.Error("Expect creds to not be expired after retrieve.")
- }
-
- os.Clearenv()
- os.Setenv("AWS_ACCESS_KEY", "access")
- os.Setenv("AWS_SECRET_KEY", "secret")
-
- expectedCreds = Value{
- AccessKeyID: "access",
- SecretAccessKey: "secret",
- SignerType: SignatureV4,
- }
-
- creds, err = e.Retrieve()
- if err != nil {
- t.Fatal(err)
- }
-
- if !reflect.DeepEqual(creds, expectedCreds) {
- t.Errorf("Expected %v, got %v", expectedCreds, creds)
- }
-
-}
-
-func TestEnvMinioRetrieve(t *testing.T) {
- os.Clearenv()
-
- os.Setenv("MINIO_ACCESS_KEY", "access")
- os.Setenv("MINIO_SECRET_KEY", "secret")
-
- e := EnvMinio{}
- if !e.IsExpired() {
- t.Error("Expect creds to be expired before retrieve.")
- }
-
- creds, err := e.Retrieve()
- if err != nil {
- t.Fatal(err)
- }
-
- expectedCreds := Value{
- AccessKeyID: "access",
- SecretAccessKey: "secret",
- SignerType: SignatureV4,
- }
- if !reflect.DeepEqual(creds, expectedCreds) {
- t.Errorf("Expected %v, got %v", expectedCreds, creds)
- }
-
- if e.IsExpired() {
- t.Error("Expect creds to not be expired after retrieve.")
- }
-}
diff --git a/vendor/github.com/minio/minio-go/pkg/credentials/file_test.go b/vendor/github.com/minio/minio-go/pkg/credentials/file_test.go
deleted file mode 100644
index c85c10494..000000000
--- a/vendor/github.com/minio/minio-go/pkg/credentials/file_test.go
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Minio Go Library for Amazon S3 Compatible Cloud Storage
- * Copyright 2017 Minio, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package credentials
-
-import (
- "os"
- "path/filepath"
- "testing"
-)
-
-func TestFileAWS(t *testing.T) {
- os.Clearenv()
-
- creds := NewFileAWSCredentials("credentials.sample", "")
- credValues, err := creds.Get()
- if err != nil {
- t.Fatal(err)
- }
-
- if credValues.AccessKeyID != "accessKey" {
- t.Errorf("Expected 'accessKey', got %s'", credValues.AccessKeyID)
- }
- if credValues.SecretAccessKey != "secret" {
- t.Errorf("Expected 'secret', got %s'", credValues.SecretAccessKey)
- }
- if credValues.SessionToken != "token" {
- t.Errorf("Expected 'token', got %s'", credValues.SessionToken)
- }
-
- os.Setenv("AWS_SHARED_CREDENTIALS_FILE", "credentials.sample")
- creds = NewFileAWSCredentials("", "")
- credValues, err = creds.Get()
- if err != nil {
- t.Fatal(err)
- }
-
- if credValues.AccessKeyID != "accessKey" {
- t.Errorf("Expected 'accessKey', got %s'", credValues.AccessKeyID)
- }
- if credValues.SecretAccessKey != "secret" {
- t.Errorf("Expected 'secret', got %s'", credValues.SecretAccessKey)
- }
- if credValues.SessionToken != "token" {
- t.Errorf("Expected 'token', got %s'", credValues.SessionToken)
- }
-
- wd, err := os.Getwd()
- if err != nil {
- t.Fatal(err)
- }
-
- os.Setenv("AWS_SHARED_CREDENTIALS_FILE", filepath.Join(wd, "credentials.sample"))
- creds = NewFileAWSCredentials("", "")
- credValues, err = creds.Get()
- if err != nil {
- t.Fatal(err)
- }
-
- if credValues.AccessKeyID != "accessKey" {
- t.Errorf("Expected 'accessKey', got %s'", credValues.AccessKeyID)
- }
- if credValues.SecretAccessKey != "secret" {
- t.Errorf("Expected 'secret', got %s'", credValues.SecretAccessKey)
- }
- if credValues.SessionToken != "token" {
- t.Errorf("Expected 'token', got %s'", credValues.SessionToken)
- }
-
- os.Clearenv()
- os.Setenv("AWS_PROFILE", "no_token")
-
- creds = NewFileAWSCredentials("credentials.sample", "")
- credValues, err = creds.Get()
- if err != nil {
- t.Fatal(err)
- }
-
- if credValues.AccessKeyID != "accessKey" {
- t.Errorf("Expected 'accessKey', got %s'", credValues.AccessKeyID)
- }
- if credValues.SecretAccessKey != "secret" {
- t.Errorf("Expected 'secret', got %s'", credValues.SecretAccessKey)
- }
-
- os.Clearenv()
-
- creds = NewFileAWSCredentials("credentials.sample", "no_token")
- credValues, err = creds.Get()
- if err != nil {
- t.Fatal(err)
- }
-
- if credValues.AccessKeyID != "accessKey" {
- t.Errorf("Expected 'accessKey', got %s'", credValues.AccessKeyID)
- }
- if credValues.SecretAccessKey != "secret" {
- t.Errorf("Expected 'secret', got %s'", credValues.SecretAccessKey)
- }
-
- creds = NewFileAWSCredentials("credentials-non-existent.sample", "no_token")
- _, err = creds.Get()
- if !os.IsNotExist(err) {
- t.Errorf("Expected open non-existent.json: no such file or directory, got %s", err)
- }
- if !creds.IsExpired() {
- t.Error("Should be expired if not loaded")
- }
-}
-
-func TestFileMinioClient(t *testing.T) {
- os.Clearenv()
-
- creds := NewFileMinioClient("config.json.sample", "")
- credValues, err := creds.Get()
- if err != nil {
- t.Fatal(err)
- }
-
- if credValues.AccessKeyID != "accessKey" {
- t.Errorf("Expected 'accessKey', got %s'", credValues.AccessKeyID)
- }
- if credValues.SecretAccessKey != "secret" {
- t.Errorf("Expected 'secret', got %s'", credValues.SecretAccessKey)
- }
- if credValues.SignerType != SignatureV4 {
- t.Errorf("Expected 'S3v4', got %s'", credValues.SignerType)
- }
-
- os.Clearenv()
- os.Setenv("MINIO_ALIAS", "play")
-
- creds = NewFileMinioClient("config.json.sample", "")
- credValues, err = creds.Get()
- if err != nil {
- t.Fatal(err)
- }
-
- if credValues.AccessKeyID != "Q3AM3UQ867SPQQA43P2F" {
- t.Errorf("Expected 'Q3AM3UQ867SPQQA43P2F', got %s'", credValues.AccessKeyID)
- }
- if credValues.SecretAccessKey != "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG" {
- t.Errorf("Expected 'zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG', got %s'", credValues.SecretAccessKey)
- }
- if credValues.SignerType != SignatureV2 {
- t.Errorf("Expected 'S3v2', got %s'", credValues.SignerType)
- }
-
- os.Clearenv()
-
- creds = NewFileMinioClient("config.json.sample", "play")
- credValues, err = creds.Get()
- if err != nil {
- t.Fatal(err)
- }
-
- if credValues.AccessKeyID != "Q3AM3UQ867SPQQA43P2F" {
- t.Errorf("Expected 'Q3AM3UQ867SPQQA43P2F', got %s'", credValues.AccessKeyID)
- }
- if credValues.SecretAccessKey != "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG" {
- t.Errorf("Expected 'zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG', got %s'", credValues.SecretAccessKey)
- }
- if credValues.SignerType != SignatureV2 {
- t.Errorf("Expected 'S3v2', got %s'", credValues.SignerType)
- }
-
- creds = NewFileMinioClient("non-existent.json", "play")
- _, err = creds.Get()
- if !os.IsNotExist(err) {
- t.Errorf("Expected open non-existent.json: no such file or directory, got %s", err)
- }
- if !creds.IsExpired() {
- t.Error("Should be expired if not loaded")
- }
-}
diff --git a/vendor/github.com/minio/minio-go/pkg/credentials/iam_aws_test.go b/vendor/github.com/minio/minio-go/pkg/credentials/iam_aws_test.go
deleted file mode 100644
index 86ea66bf6..000000000
--- a/vendor/github.com/minio/minio-go/pkg/credentials/iam_aws_test.go
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Minio Go Library for Amazon S3 Compatible Cloud Storage
- * Copyright 2017 Minio, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package credentials
-
-import (
- "fmt"
- "net/http"
- "net/http/httptest"
- "testing"
- "time"
-)
-
-const credsRespTmpl = `{
- "Code": "Success",
- "Type": "AWS-HMAC",
- "AccessKeyId" : "accessKey",
- "SecretAccessKey" : "secret",
- "Token" : "token",
- "Expiration" : "%s",
- "LastUpdated" : "2009-11-23T0:00:00Z"
-}`
-
-const credsFailRespTmpl = `{
- "Code": "ErrorCode",
- "Message": "ErrorMsg",
- "LastUpdated": "2009-11-23T0:00:00Z"
-}`
-
-func initTestFailServer() *httptest.Server {
- server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- http.Error(w, "Not allowed", http.StatusBadRequest)
- }))
- return server
-}
-
-func initTestServerNoRoles() *httptest.Server {
- server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- w.Write([]byte(""))
- }))
- return server
-}
-
-func initTestServer(expireOn string, failAssume bool) *httptest.Server {
- server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- if r.URL.Path == "/latest/meta-data/iam/security-credentials" {
- fmt.Fprintln(w, "RoleName")
- } else if r.URL.Path == "/latest/meta-data/iam/security-credentials/RoleName" {
- if failAssume {
- fmt.Fprintf(w, credsFailRespTmpl)
- } else {
- fmt.Fprintf(w, credsRespTmpl, expireOn)
- }
- } else {
- http.Error(w, "bad request", http.StatusBadRequest)
- }
- }))
-
- return server
-}
-
-func TestIAMMalformedEndpoint(t *testing.T) {
- creds := NewIAM("%%%%")
- _, err := creds.Get()
- if err == nil {
- t.Fatal("Unexpected should fail here")
- }
- if err.Error() != `parse %%%%: invalid URL escape "%%%"` {
- t.Fatalf("Expected parse %%%%%%%%: invalid URL escape \"%%%%%%\", got %s", err)
- }
-}
-
-func TestIAMFailServer(t *testing.T) {
- server := initTestFailServer()
- defer server.Close()
-
- creds := NewIAM(server.URL)
-
- _, err := creds.Get()
- if err == nil {
- t.Fatal("Unexpected should fail here")
- }
- if err.Error() != "400 Bad Request" {
- t.Fatalf("Expected '400 Bad Request', got %s", err)
- }
-}
-
-func TestIAMNoRoles(t *testing.T) {
- server := initTestServerNoRoles()
- defer server.Close()
-
- creds := NewIAM(server.URL)
- _, err := creds.Get()
- if err == nil {
- t.Fatal("Unexpected should fail here")
- }
- if err.Error() != "No IAM roles attached to this EC2 service" {
- t.Fatalf("Expected 'No IAM roles attached to this EC2 service', got %s", err)
- }
-}
-
-func TestIAM(t *testing.T) {
- server := initTestServer("2014-12-16T01:51:37Z", false)
- defer server.Close()
-
- p := &IAM{
- Client: http.DefaultClient,
- endpoint: server.URL,
- }
-
- creds, err := p.Retrieve()
- if err != nil {
- t.Fatal(err)
- }
-
- if "accessKey" != creds.AccessKeyID {
- t.Errorf("Expected \"accessKey\", got %s", creds.AccessKeyID)
- }
-
- if "secret" != creds.SecretAccessKey {
- t.Errorf("Expected \"secret\", got %s", creds.SecretAccessKey)
- }
-
- if "token" != creds.SessionToken {
- t.Errorf("Expected \"token\", got %s", creds.SessionToken)
- }
-
- if !p.IsExpired() {
- t.Error("Expected creds to be expired.")
- }
-}
-
-func TestIAMFailAssume(t *testing.T) {
- server := initTestServer("2014-12-16T01:51:37Z", true)
- defer server.Close()
-
- p := &IAM{
- Client: http.DefaultClient,
- endpoint: server.URL,
- }
-
- _, err := p.Retrieve()
- if err == nil {
- t.Fatal("Unexpected success, should fail")
- }
- if err.Error() != "ErrorMsg" {
- t.Errorf("Expected \"ErrorMsg\", got %s", err)
- }
-}
-
-func TestIAMIsExpired(t *testing.T) {
- server := initTestServer("2014-12-16T01:51:37Z", false)
- defer server.Close()
-
- p := &IAM{
- Client: http.DefaultClient,
- endpoint: server.URL,
- }
- p.CurrentTime = func() time.Time {
- return time.Date(2014, 12, 15, 21, 26, 0, 0, time.UTC)
- }
-
- if !p.IsExpired() {
- t.Error("Expected creds to be expired before retrieve.")
- }
-
- _, err := p.Retrieve()
- if err != nil {
- t.Fatal(err)
- }
-
- if p.IsExpired() {
- t.Error("Expected creds to not be expired after retrieve.")
- }
-
- p.CurrentTime = func() time.Time {
- return time.Date(3014, 12, 15, 21, 26, 0, 0, time.UTC)
- }
-
- if !p.IsExpired() {
- t.Error("Expected creds to be expired when curren time has changed")
- }
-}
diff --git a/vendor/github.com/minio/minio-go/pkg/credentials/static_test.go b/vendor/github.com/minio/minio-go/pkg/credentials/static_test.go
deleted file mode 100644
index f1d2d856c..000000000
--- a/vendor/github.com/minio/minio-go/pkg/credentials/static_test.go
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Minio Go Library for Amazon S3 Compatible Cloud Storage
- * Copyright 2017 Minio, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package credentials
-
-import "testing"
-
-func TestStaticGet(t *testing.T) {
- creds := NewStatic("UXHW", "SECRET", "", SignatureV4)
- credValues, err := creds.Get()
- if err != nil {
- t.Fatal(err)
- }
-
- if "UXHW" != credValues.AccessKeyID {
- t.Errorf("Expected access key ID to match \"UXHW\", got %s", credValues.AccessKeyID)
- }
- if "SECRET" != credValues.SecretAccessKey {
- t.Errorf("Expected secret access key to match \"SECRET\", got %s", credValues.SecretAccessKey)
- }
-
- if credValues.SessionToken != "" {
- t.Error("Expected session token to match")
- }
-
- if credValues.SignerType != SignatureV4 {
- t.Errorf("Expected 'S3v4', got %s", credValues.SignerType)
- }
-
- if creds.IsExpired() {
- t.Error("Static credentials should never expire")
- }
-
- creds = NewStatic("", "", "", SignatureDefault)
- credValues, err = creds.Get()
- if err != nil {
- t.Fatal(err)
- }
-
- if "" != credValues.AccessKeyID {
- t.Errorf("Expected access key ID to match empty string, got %s", credValues.AccessKeyID)
- }
- if "" != credValues.SecretAccessKey {
- t.Errorf("Expected secret access key to match empty string, got %s", credValues.SecretAccessKey)
- }
-
- if !credValues.SignerType.IsAnonymous() {
- t.Errorf("Expected 'Anonymous', got %s", credValues.SignerType)
- }
-
- if creds.IsExpired() {
- t.Error("Static credentials should never expire")
- }
-}