From 8ea67a996e4cdb384b3210b5f996482d23482946 Mon Sep 17 00:00:00 2001 From: Ryan Emery Date: Thu, 3 Oct 2019 15:07:05 -0700 Subject: [PATCH 1/2] doc: document breaking changes Document the breaking changes in moving from `preview` to `1.0.0`. --- README.md | 14 ++++++++++++++ modules/encrypt-node/CHANGELOG.md | 11 ++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d4da009ca..9600031e8 100644 --- a/README.md +++ b/README.md @@ -80,3 +80,17 @@ npm test This SDK is distributed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), see LICENSE.txt and NOTICE.txt for more information. + +# Breaking changes from `preview` to `1.0.0` + +The AWS Encryption SDK for JavaScript is generally available +as of October 1, 2019. +There were breaking changes during the `preview`. + +* Passing encryption context to `encrypt` is now `{ encryptionContext?: EncryptionContext }` [#148][encryptionContext] +* The return value of `encrypt` is now `{result: Uint8Array, messageHeader: MessageHeader}` [#211][encryptResult] +* `encrypt` strictly enforces `plaintextLength` [#213][plaintextLength] + +[encryptionContext]: https://github.com/aws/aws-encryption-sdk-javascript/pull/148 +[encryptResult]: https://github.com/aws/aws-encryption-sdk-javascript/pull/211 +[plaintextLength]: https://github.com/aws/aws-encryption-sdk-javascript/pull/213 diff --git a/modules/encrypt-node/CHANGELOG.md b/modules/encrypt-node/CHANGELOG.md index d3e5cd786..26653278a 100644 --- a/modules/encrypt-node/CHANGELOG.md +++ b/modules/encrypt-node/CHANGELOG.md @@ -19,8 +19,12 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline * Encrypt name to result (#211) 03061d1, closes #211 * plaintextLength must be enforced (#213) 1788d25, closes #213 +### BREAKING CHANGES - +* `encrypt` now returns `{result: Uint8Array, messageHeader: MessageHeader}` +instead of `{ciphertext: Uint8Array, messageHeader: MessageHeader}`. +* `encrypt` and `encryptStream` will now throw +if the caller tries to encrypt more data than `plaintextLength`. # [0.1.0-preview.3](/compare/@aws-crypto/encrypt-node@0.1.0-preview.2...@aws-crypto/encrypt-node@0.1.0-preview.3) (2019-08-08) @@ -31,9 +35,10 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline * Encryption Context changes (#148) 5a7e9ca, closes #148 #54 * framLength is not passed to the CMM (#190) b60f653, closes #190 #161 +### BREAKING CHANGES - - +* `encrypt` and `encryptStream` now expect the encryption context +to be passed as `encryptionContext` instead of `context`. # [0.1.0-preview.2](/compare/@aws-crypto/encrypt-node@0.1.0-preview.1...@aws-crypto/encrypt-node@0.1.0-preview.2) (2019-07-24) From 3569b83d920a0847d399bd83160494ef02cacf74 Mon Sep 17 00:00:00 2001 From: Ryan Emery Date: Thu, 3 Oct 2019 17:19:10 -0700 Subject: [PATCH 2/2] document breaking changes --- modules/decrypt-browser/CHANGELOG.md | 3 +++ modules/encrypt-browser/CHANGELOG.md | 7 +++++++ modules/integration-browser/CHANGELOG.md | 3 +++ modules/integration-node/CHANGELOG.md | 4 ++++ modules/material-management/CHANGELOG.md | 11 +++++++++++ 5 files changed, 28 insertions(+) diff --git a/modules/decrypt-browser/CHANGELOG.md b/modules/decrypt-browser/CHANGELOG.md index 9c5023ea2..530fe6d09 100644 --- a/modules/decrypt-browser/CHANGELOG.md +++ b/modules/decrypt-browser/CHANGELOG.md @@ -27,7 +27,10 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline * encrypt/decrypt interface should be the same (#189) ff78f94, closes #189 #182 * Encryption Context changes (#148) 5a7e9ca, closes #148 #54 +### BREAKING CHANGES +* `decrypt` now returns `{plaintext: Uint8Array, messageHeader: MessageHeader}` +instead of `{clearMessage: Uint8Array, messageHeader: MessageHeader}`. diff --git a/modules/encrypt-browser/CHANGELOG.md b/modules/encrypt-browser/CHANGELOG.md index 172d9ec9c..932c484db 100644 --- a/modules/encrypt-browser/CHANGELOG.md +++ b/modules/encrypt-browser/CHANGELOG.md @@ -18,7 +18,10 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline * Encrypt name to result (#211) 03061d1, closes #211 +### BREAKING CHANGES +* `encrypt` now returns `{result: Uint8Array, messageHeader: MessageHeader}` +instead of `{ciphertext: Uint8Array, messageHeader: MessageHeader}`. @@ -32,6 +35,10 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline * framLength is not passed to the CMM (#190) b60f653, closes #190 #161 +### BREAKING CHANGES + +* `encrypt` now returns `{ciphertext: Uint8Array, messageHeader: MessageHeader}` +instead of `{cipherMessage: Uint8Array, messageHeader: MessageHeader}`. diff --git a/modules/integration-browser/CHANGELOG.md b/modules/integration-browser/CHANGELOG.md index a83dc0d67..57117c9bb 100644 --- a/modules/integration-browser/CHANGELOG.md +++ b/modules/integration-browser/CHANGELOG.md @@ -47,7 +47,10 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline * Encryption tests for integration-browser (#159) 043506d, closes #159 +### BREAKING CHANGES +* The cli now takes `encrypt` and `decrypt` as a command, +instead of only supporting decrypt testing. diff --git a/modules/integration-node/CHANGELOG.md b/modules/integration-node/CHANGELOG.md index d87badc87..c52a86c6c 100644 --- a/modules/integration-node/CHANGELOG.md +++ b/modules/integration-node/CHANGELOG.md @@ -38,6 +38,10 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline * Encryption tests for integration-node (#153) d7b5e73, closes #153 +### BREAKING CHANGES + +* The cli now takes `encrypt` and `decrypt` as a command, +instead of only supporting decrypt testing. diff --git a/modules/material-management/CHANGELOG.md b/modules/material-management/CHANGELOG.md index 5fcf410a4..16d22f97a 100644 --- a/modules/material-management/CHANGELOG.md +++ b/modules/material-management/CHANGELOG.md @@ -26,7 +26,9 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline * Remove unencryptedDataKeyLength (#201) bd160c0, closes #201 * Suport Node.js crypto KeyObjects (#200) 77ad031, closes #200 #74 +### BREAKING CHANGES +* CryptographicMaterial no longer support `unencryptedDataKeyLength` @@ -40,7 +42,16 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline * framLength is not passed to the CMM (#190) b60f653, closes #190 #161 * Multi keyrings should not require a generator (#165) 11ff819, closes #165 +### BREAKING CHANGES +* CryptographicMaterial now require `encryptionContext` on creation. +this includes `NodeDecryptionMaterial`, `NodeEncryptionMaterial`, +`WebCryptoEncryptionMaterial`, and `WebCryptoDecryptionMaterial`. +* The Keyring base class no longer accepts `encryptionContext` +for `onDecrypt` and `onEncrypt`. +It now gets this value from the CryptographicMaterial passed. +* The CMM interface now returns CryptographicMaterial +instead of a complex object with material and context.