Support AWS Signature V2 for Mattermost for S3 storage. (#6462)
Certain S3 compatible servers only use Legacy Signature (AWS Signature V2), current code only supports signature v4. This PR adds facility to click a button on the UI to enable legacy signature with S3 compatible servers.
Этот коммит содержится в:
коммит произвёл
Corey Hulen
родитель
d409c7c1c6
Коммит
f520aa1f4d
@@ -20,8 +20,6 @@ import (
|
||||
"github.com/mattermost/platform/model"
|
||||
"github.com/mattermost/platform/store"
|
||||
"github.com/mattermost/platform/utils"
|
||||
|
||||
s3 "github.com/minio/minio-go"
|
||||
)
|
||||
|
||||
func TestCreateUser(t *testing.T) {
|
||||
@@ -696,7 +694,8 @@ func TestUserCreateImage(t *testing.T) {
|
||||
accessKey := utils.Cfg.FileSettings.AmazonS3AccessKeyId
|
||||
secretKey := utils.Cfg.FileSettings.AmazonS3SecretAccessKey
|
||||
secure := *utils.Cfg.FileSettings.AmazonS3SSL
|
||||
s3Clnt, err := s3.New(endpoint, accessKey, secretKey, secure)
|
||||
signV2 := *utils.Cfg.FileSettings.AmazonS3SignV2
|
||||
s3Clnt, err := s3New(endpoint, accessKey, secretKey, secure, signV2)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -800,7 +799,8 @@ func TestUserUploadProfileImage(t *testing.T) {
|
||||
accessKey := utils.Cfg.FileSettings.AmazonS3AccessKeyId
|
||||
secretKey := utils.Cfg.FileSettings.AmazonS3SecretAccessKey
|
||||
secure := *utils.Cfg.FileSettings.AmazonS3SSL
|
||||
s3Clnt, err := s3.New(endpoint, accessKey, secretKey, secure)
|
||||
signV2 := *utils.Cfg.FileSettings.AmazonS3SignV2
|
||||
s3Clnt, err := s3New(endpoint, accessKey, secretKey, secure, signV2)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user