Skip to content

Flag deprecated encryptString/decryptString APIs as deprecated. #120

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

Merged
merged 8 commits into from
Oct 9, 2019
Merged

Flag deprecated encryptString/decryptString APIs as deprecated. #120

merged 8 commits into from
Oct 9, 2019

Conversation

lizroth
Copy link
Contributor

@lizroth lizroth commented Jul 30, 2019

Issue #, if available: n/a

Description of changes:

  • Add @Deprecated to deprecated APIs
  • Update Javadoc about deprecation
  • Opportunistic improvement of incomplete Javadoc on decryptData()

Background: the encryptString/decryptString APIs were an early approach to try to provide helpful encoding for string ciphertexts. However, the AWS Encryption SDKs in general attempt to be agnostic as to the data format that users want to use for their ciphertexts, so over the longer term these APIs have turned out to be more confusing than beneficial for customers. As such, most Encryption SDKs do not support these APIs by design.

Only the Java ESDK has these APIs, because Java was the original implementation, and at the time it was a more significant convenience improvement to offer these APIs to Java developers.

This PR deprecates those APIs to make it clear to our users which APIs are interoperable and to encourage our users to prefer the ones that are.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Check any applicable:

  • Were any files moved? Moving files changes their URL, which breaks all hyperlinks to the files.

* Add @deprecated to deprecated APIs
* Update Javadoc about deprecation
* Opportunistic improvement of incomplete Javadoc on decryptData()
@@ -281,7 +281,12 @@ public long estimateCiphertextSize(
/**
* Calls {@link #encryptData(MasterKeyProvider, byte[], Map)} on the UTF-8 encoded bytes of
* {@code plaintext} and base64 encodes the result.
* @deprecated Use the {@link #encryptData(MasterKeyProvider, byte[], Map)} and
* {@link #decryptData(MasterKeyProvider, byte[])} APIs instead. {@code encryptString} is incompatible with the
Copy link
Member

Choose a reason for hiding this comment

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

I would not say that they are incompatible without clarification. Maybe "because the the output must be base64-decoded to be compatible with other AWS Encryption SDK implementations"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Works for me, I am but a deprecation-shaped vessel for the wordsmithing that you guys think make sense.

Copy link
Contributor

@juneb juneb Jul 31, 2019

Choose a reason for hiding this comment

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

Because these APIs return Base64-encoded output, they are not compatible with other AWS Encryption SDK language implementations.

Copy link
Member

@mattsb42-aws mattsb42-aws Aug 1, 2019

Choose a reason for hiding this comment

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

Because these APIs return Base64-encoded output, they are not compatible with other AWS Encryption SDK language implementations.

IMO this still conveys the wrong message.
What I would like to make sure we're communicating is that they are compatible, but only once you peal away an extra layer of encoding that this method adds.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After some noodling, I've tried again to be clear and concise in explaining that this is deprecated, and why. When you have a second, please let me know what you think of the new wording.

@juneb
Copy link
Contributor

juneb commented Jul 31, 2019

@lizroth We should also add the deprecation message to the example that demonstrates how to use the encryptString and decryptString methods, or remove them.

https://github.com/aws/aws-encryption-sdk-java/blob/master/src/examples/java/com/amazonaws/crypto/examples/StringExample.java

@lizroth
Copy link
Contributor Author

lizroth commented Aug 2, 2019

@lizroth We should also add the deprecation message to the example that demonstrates how to use the encryptString and decryptString methods, or remove them.

https://github.com/aws/aws-encryption-sdk-java/blob/master/src/examples/java/com/amazonaws/crypto/examples/StringExample.java

Agreed. Removed the example.

@lizroth lizroth requested a review from mattsb42-aws August 2, 2019 22:39
mattsb42-aws
mattsb42-aws previously approved these changes Aug 2, 2019
Copy link
Member

@mattsb42-aws mattsb42-aws left a comment

Choose a reason for hiding this comment

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

:D

seebees
seebees previously approved these changes Oct 9, 2019
Removing example code for deprecated functions.

Original commit got lost in PR cleanup.
mattsb42-aws
mattsb42-aws previously approved these changes Oct 9, 2019
@lizroth lizroth dismissed stale reviews from mattsb42-aws and seebees via 2248c40 October 9, 2019 00:17
@lizroth lizroth merged commit a600292 into aws:master Oct 9, 2019
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