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

service/s3/s3crypto: Added X-Ray support to s3crypto decryption client #2912

Merged
merged 8 commits into from Jan 14, 2020

Conversation

alexbilbie
Copy link
Contributor

@alexbilbie alexbilbie commented Oct 27, 2019

The s3crypto package is not passing a context object down to the KMS client calls so panics were being emitted by the X-Ray SDK.

This replaces my original PR #2783 in which @jasdel pointed out I'd break backwards compatibility.

I've found a relatively simple method of passing the request to the KMS client by introducing an additional interface CipherDataDecrypterWithContext which the KMS key handler conforms to. The decryption client then checks if the decrypter is of this type and if so calls the alternative method exposed in this interface.

I've not attempted to implement this for the PutObject method on the encryption client as I just couldn't find a simple way of introducing new code without breaking backwards compatibility.

I've tested my changes successfully:

Screenshot 2019-10-27 at 22 34 18

@skmcgrail skmcgrail added the needs-review This issue or pull request needs review from a core team member. label Nov 14, 2019
@jasdel jasdel changed the title Added X-Ray support to s3crypto decryption client service/s3/s3crypto: Added X-Ray support to s3crypto decryption client Jan 2, 2020
Copy link
Contributor

@jasdel jasdel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the time to create this PR. I've made a few tweaks adding support for Context being passed down to KMS client during encryption as well as decrypt. I used a similar technique as used for decryption with the additional interfaces.

@jasdel jasdel removed the needs-review This issue or pull request needs review from a core team member. label Jan 2, 2020
@jasdel jasdel merged commit 768d541 into aws:master Jan 14, 2020
aws-sdk-go-automation pushed a commit that referenced this pull request Jan 15, 2020
===

### Service Client Updates
* `service/ec2`: Updates service API and documentation
  * General Update to EC2 Docs and SDKs
* `service/organizations`: Updates service documentation
  * Updated description for PolicyID parameter and ConstraintViolationException.
* `service/securityhub`: Updates service API and documentation
* `service/ssm`: Updates service documentation
  * Document updates for Patch Manager 'NoReboot' feature.

### SDK Enhancements
* `service/s3/s3crypto`: Added X-Ray support to encrypt/decrypt clients ([#2912](#2912))
  * Adds support for passing Context down to the crypto client's KMS client enabling tracing for tools like X-Ray, and metrics.
aws-sdk-go-automation added a commit that referenced this pull request Jan 15, 2020
Release v1.28.3 (2020-01-15)
===

### Service Client Updates
* `service/ec2`: Updates service API and documentation
  * General Update to EC2 Docs and SDKs
* `service/organizations`: Updates service documentation
  * Updated description for PolicyID parameter and ConstraintViolationException.
* `service/securityhub`: Updates service API and documentation
* `service/ssm`: Updates service documentation
  * Document updates for Patch Manager 'NoReboot' feature.

### SDK Enhancements
* `service/s3/s3crypto`: Added X-Ray support to encrypt/decrypt clients ([#2912](#2912))
  * Adds support for passing Context down to the crypto client's KMS client enabling tracing for tools like X-Ray, and metrics.
@alexbilbie alexbilbie deleted the s3crypto-xray-v2 branch June 4, 2020 15:53
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.

None yet

4 participants