Skip to content
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

Merged
merged 1 commit into from
Jul 4, 2017

Conversation

balamurugana
Copy link
Member

@balamurugana balamurugana commented Jul 3, 2017

When multiple source objects are used for compose object, errors out
if client side encryption is used in source object.

Fixes #738

@@ -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") != "" {
Copy link
Member

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

@balamurugana balamurugana changed the title Error out if client side encryption is used for copy object. Handle source objects used client side encryption for compose object. Jul 3, 2017
@deekoder deekoder requested review from krisis and harshavardhana July 3, 2017 17:40
harshavardhana
harshavardhana previously approved these changes Jul 4, 2017
@@ -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") != "" {
Copy link
Member

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.

Copy link
Member

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.

Copy link
Member Author

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
@deekoder deekoder merged commit fb54c1d into minio:master Jul 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants