-
Notifications
You must be signed in to change notification settings - Fork 657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle source objects used client side encryption for compose object. #739
Conversation
api-compose-object.go
Outdated
@@ -315,6 +315,12 @@ func (c Client) ComposeObject(dst DestinationInfo, srcs []SourceInfo) error { | |||
return fmt.Errorf("Could not get source props for %s/%s: %v", src.bucket, src.object, err) | |||
} | |||
|
|||
// Error out if client side encryption is used in this source object. | |||
if src.Headers.Get("x-amz-meta-x-amz-key") != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you verify what is the AWS S3 behavior in this scenario? @balamurugana
api-compose-object.go
Outdated
@@ -315,6 +315,13 @@ func (c Client) ComposeObject(dst DestinationInfo, srcs []SourceInfo) error { | |||
return fmt.Errorf("Could not get source props for %s/%s: %v", src.bucket, src.object, err) | |||
} | |||
|
|||
// Error out if client side encryption is used in this source object when | |||
// more than one source objects are given. | |||
if i > 0 && src.Headers.Get("x-amz-meta-x-amz-key") != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check won't catch the case where the first source object is encrypted while others are not. I.e, i == 0 && src.Headers.Get("x-amz-meta-x-amz-key") != ""
is true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Come to think of it i think this code needs to loop through an validates all sourceInfos.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Fixing.
When multiple source objects are used for compose object, errors out if client side encryption is used in source object. Fixes minio#738
When multiple source objects are used for compose object, errors out
if client side encryption is used in source object.
Fixes #738