Skip to content

Commit

Permalink
Handle source objects used client side encryption for compose object. (
Browse files Browse the repository at this point in the history
…#739)

When multiple source objects are used for compose object, errors out
if client side encryption is used in source object.
Fixes #738
  • Loading branch information
balamurugana authored and deekoder committed Jul 4, 2017
1 parent 80e4a4e commit fb54c1d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api-compose-object.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,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 len(srcs) > 1 && src.Headers.Get("x-amz-meta-x-amz-key") != "" {
return ErrInvalidArgument(
fmt.Sprintf("Client side encryption is used in source object %s/%s", src.bucket, src.object))
}

// Since we did a HEAD to get size, we use the ETag
// value to make sure the object has not changed by
// the time we perform the copy. This is done, only if
Expand Down

0 comments on commit fb54c1d

Please sign in to comment.