[#217] Consider Copy-Source-SSE-* headers during copy #246
Labels
No labels
P0
P1
P2
P3
good first issue
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-s3-gw#246
Loading…
Reference in a new issue
No description provided.
Delete branch "mbiryukova/frostfs-s3-gw:feature/fix_copy_source_sse_handling"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #217
Signed-off-by: Marina Biryukova m.biryukova@yadro.com
383e042aa1
to48b9b5def2
@ -116,2 +121,2 @@
if err = encryptionParams.MatchObjectEncryption(layer.FormEncryptionInfo(srcObjInfo.Headers)); err != nil {
h.logAndSendError(w, "encryption doesn't match object", reqInfo, errors.GetAPIError(errors.ErrBadRequest), zap.Error(err))
if err = srcEncryptionParams.MatchObjectEncryption(layer.FormEncryptionInfo(srcObjInfo.Headers)); err != nil {
if errors.IsS3Error(err, errors.ErrInvalidEncryptionParameters) || errors.IsS3Error(err, errors.ErrSSEEncryptedObject) ||
Why did we add this condition? It seems in both cases we execute the same code
If condition is false
ErrBadRequest
should be returned as before, fixed this@ -271,3 +285,3 @@
res := make(map[string]string, len(headers))
for key, val := range headers {
res[key] = val
if _, ok := layer.EncryptionMetadata[key]; !ok {
Let's keep
makeCopyMap
as is. But create new function that deletes all unnecessary metadata from map. This new function should delete not onlylayer.EncryptionMetadata
, but alsolayer.MultipartObjectSize
(see48b9b5def2/api/handler/copy.go (L190)
)@ -377,3 +375,1 @@
sseCustomerAlgorithm := r.Header.Get(api.AmzServerSideEncryptionCustomerAlgorithm)
sseCustomerKey := r.Header.Get(api.AmzServerSideEncryptionCustomerKey)
sseCustomerKeyMD5 := r.Header.Get(api.AmzServerSideEncryptionCustomerKeyMD5)
func formEncryptionParams(r *http.Request, isCopySource bool) (enc encryption.Params, err error) {
Optional: can we write
?
48b9b5def2
to9a764aa3e6
@ -278,0 +292,4 @@
func filterMetadataMap(metadata map[string]string) {
delete(metadata, layer.MultipartObjectSize) // object payload will be real one rather than list of compound parts
for key := range metadata {
if _, ok := layer.EncryptionMetadata[key]; ok {
It seems we can write this
instead of this
9a764aa3e6
tof9c3c970dd
f9c3c970dd
to5b58b9ed87
5b58b9ed87
tobf0db023ad
bf0db023ad
to3ff70a1b8e