mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-01-11 03:11:50 +00:00
Enforce SSE/StorageClass in PUT Object Copy
"RenameFile" is implemented in S3 using `PUT Object Copy`, which should enforce SSE/StorageClass same way as regular `PUT Object`. Fixes: #647
This commit is contained in:
@@ -370,6 +370,13 @@ func (storage *PublishedStorage) RenameFile(oldName, newName string) error {
|
||||
ACL: aws.String(storage.acl),
|
||||
}
|
||||
|
||||
if storage.storageClass != "" {
|
||||
params.StorageClass = aws.String(storage.storageClass)
|
||||
}
|
||||
if storage.encryptionMethod != "" {
|
||||
params.ServerSideEncryption = aws.String(storage.encryptionMethod)
|
||||
}
|
||||
|
||||
_, err := storage.s3.CopyObject(params)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error copying %s -> %s in %s: %s", oldName, newName, storage, err)
|
||||
|
||||
Reference in New Issue
Block a user