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
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
c506c5cac6
Коммит
489602efe5
@@ -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)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user