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

fix missing plaintext in bulk decrypt response #9991

Merged
merged 5 commits into from
Sep 22, 2020

Conversation

ins0
Copy link
Contributor

@ins0 ins0 commented Sep 18, 2020

This PR

Decrypting an ciphertext where its corresponding value equals empty, the payload property "plaintext" is missing in the response object. This fixes the problem by adding a new, distinct struct for decrypt batch response items where "omitempty" is not set.
Adding a empty string plaintext to the tests to batch decrypt test.

Refactor the test assertion to check against json. This checks the correct order of the items and if the empty plaintext string is contained in the result as expected.
Adding a empty string plaintext to the tests to batch decrypt test.

Refactor the test assertion to check against json. This checks the correct order of the items and if the empty plaintext string is contained in the result as expected.
@ncabatoff
Copy link
Contributor

This looks good. Can you also remove the field BatchResponseItem.Plaintext and rename BatchResponseItem to EncryptBatchResponseItem please?

@ins0
Copy link
Contributor Author

ins0 commented Sep 22, 2020

@ncabatoff sure thing, done :)

@ncabatoff ncabatoff merged commit c9342a0 into hashicorp:master Sep 22, 2020
@ncabatoff
Copy link
Contributor

Thanks @ins0 !

@ins0 ins0 deleted the fix/batch-response branch September 22, 2020 13:49
@mladlow mladlow added this to the 1.5.5 milestone Sep 28, 2020
@mladlow mladlow modified the milestones: 1.5.5, 1.6 Oct 20, 2020
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.

Transit Encryption - batch decrypting an empty string returns a badly formatted response
3 participants