summaryrefslogtreecommitdiffstats
path: root/api/user_test.go
diff options
context:
space:
mode:
authorHarshavardhana <harsha@minio.io>2017-07-31 09:22:52 -0700
committerHarrison Healey <harrisonmhealey@gmail.com>2017-07-31 12:22:52 -0400
commit489602efe5e099f57bb2b58b7c67f8fc104ff5db (patch)
tree1b5c021ba02d6495f85e9dd8d2a43406f74e0308 /api/user_test.go
parentc506c5cac6627a42af778d744cdd36d6d7abaeb2 (diff)
downloadchat-489602efe5e099f57bb2b58b7c67f8fc104ff5db.tar.gz
chat-489602efe5e099f57bb2b58b7c67f8fc104ff5db.tar.bz2
chat-489602efe5e099f57bb2b58b7c67f8fc104ff5db.zip
Allow regions to be set and honored for S3 driver. (#7010)
This is necessary for certain users where GetBucketLocation API is disabled using IAM policies. There is a field AmazonS3Region which we need to re-purpose and use to support this properly. Fixes https://github.com/mattermost/platform/issues/6999
Diffstat (limited to 'api/user_test.go')
-rw-r--r--api/user_test.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/api/user_test.go b/api/user_test.go
index 51e4482b7..f76403ee1 100644
--- a/api/user_test.go
+++ b/api/user_test.go
@@ -695,7 +695,8 @@ func TestUserCreateImage(t *testing.T) {
secretKey := utils.Cfg.FileSettings.AmazonS3SecretAccessKey
secure := *utils.Cfg.FileSettings.AmazonS3SSL
signV2 := *utils.Cfg.FileSettings.AmazonS3SignV2
- s3Clnt, err := s3New(endpoint, accessKey, secretKey, secure, signV2)
+ region := utils.Cfg.FileSettings.AmazonS3Region
+ s3Clnt, err := s3New(endpoint, accessKey, secretKey, secure, signV2, region)
if err != nil {
t.Fatal(err)
}
@@ -800,7 +801,8 @@ func TestUserUploadProfileImage(t *testing.T) {
secretKey := utils.Cfg.FileSettings.AmazonS3SecretAccessKey
secure := *utils.Cfg.FileSettings.AmazonS3SSL
signV2 := *utils.Cfg.FileSettings.AmazonS3SignV2
- s3Clnt, err := s3New(endpoint, accessKey, secretKey, secure, signV2)
+ region := utils.Cfg.FileSettings.AmazonS3Region
+ s3Clnt, err := s3New(endpoint, accessKey, secretKey, secure, signV2, region)
if err != nil {
t.Fatal(err)
}