S3: add ACL support

Fixes #610
This commit is contained in:
Nicola Murino
2021-11-13 16:05:40 +01:00
parent 78233ff9a3
commit ee5c5e033d
11 changed files with 51 additions and 4 deletions

View File

@@ -169,6 +169,9 @@ func (c *S3FsConfig) isEqual(other *S3FsConfig) bool {
if c.StorageClass != other.StorageClass {
return false
}
if c.ACL != other.ACL {
return false
}
if c.UploadPartSize != other.UploadPartSize {
return false
}
@@ -187,6 +190,10 @@ func (c *S3FsConfig) isEqual(other *S3FsConfig) bool {
if c.ForcePathStyle != other.ForcePathStyle {
return false
}
return c.isSecretEqual(other)
}
func (c *S3FsConfig) isSecretEqual(other *S3FsConfig) bool {
if c.AccessSecret == nil {
c.AccessSecret = kms.NewEmptySecret()
}
@@ -263,6 +270,8 @@ func (c *S3FsConfig) Validate() error {
c.KeyPrefix += "/"
}
}
c.StorageClass = strings.TrimSpace(c.StorageClass)
c.ACL = strings.TrimSpace(c.ACL)
return c.checkPartSizeAndConcurrency()
}
@@ -329,6 +338,7 @@ func (c *GCSFsConfig) Validate(credentialsFilePath string) error {
return errors.New("credentials cannot be empty")
}
}
c.StorageClass = strings.TrimSpace(c.StorageClass)
return nil
}