feat: fix post policy escape bug, update conformance tests#924
feat: fix post policy escape bug, update conformance tests#924JesseLovelace merged 2 commits intomasterfrom
Conversation
elharo
left a comment
There was a problem hiding this comment.
Is there a bug reference for this?
| switch (c) { | ||
| case '\\': | ||
| escapedJson.append("\\\\"); | ||
| // The JsonObject/JsonArray operations above handle quote escapes, so leave any "/"" |
There was a problem hiding this comment.
is forward slash meant here? Looks like it should be a backslash
There was a problem hiding this comment.
Should be, will fix
| // Java automatically unescapes the unicode escapes in the conformance tests, so we need to | ||
| // manually re-escape them | ||
| for (char c : expectedPolicy.toCharArray()) { | ||
| char[] expectedPolicyArray = expectedPolicy.toCharArray(); |
There was a problem hiding this comment.
This appears to be reproducing the algorithm in the test. That risks copying bugs from one place to another, and verifying the buggy behavior. Can you make the expected output a literal?
There was a problem hiding this comment.
Yeah, they both happen to need to do the same thing (escaping certain characters). Sorry, I'm unsure what you mean by "make it a literal," can you elaborate?
| <groupId>com.google.cloud</groupId> | ||
| <artifactId>google-cloud-conformance-tests</artifactId> | ||
| <version>0.0.11</version> | ||
| <version>0.1.1</version> |
There was a problem hiding this comment.
Does this verify the change?
There was a problem hiding this comment.
Yeah, in fact the failures caused by it is what brought the bug to my attention (#510)
BenWhitehead
left a comment
There was a problem hiding this comment.
Feel free to merge after fixing the typo
🤖 I have created a release \*beep\* \*boop\* --- ## [2.1.0](https://www.github.com/googleapis/java-storage/compare/v2.0.2...v2.1.0) (2021-08-24) ### Features * fix post policy escape bug, update conformance tests ([#924](https://www.github.com/googleapis/java-storage/issues/924)) ([d8329c3](https://www.github.com/googleapis/java-storage/commit/d8329c34fe19fd8c6bba5579aa3c55490c1d4e6f)) ### Dependencies * update dependency com.google.cloud:google-cloud-shared-dependencies to v2.1.0 ([#976](https://www.github.com/googleapis/java-storage/issues/976)) ([5cac14d](https://www.github.com/googleapis/java-storage/commit/5cac14d7785ef3798c379d17cd44500958d9cc6a)) * update kms.version to v0.91.2 ([#977](https://www.github.com/googleapis/java-storage/issues/977)) ([1c60e6e](https://www.github.com/googleapis/java-storage/commit/1c60e6e6a34f662478043989b5b0bddea32cc5bf)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
V4 Post Policy had an issue where quotes in the json policy would get double escaped (
"would became\\"instead of\"), this fixes that issue and updates the conformance tests to the latest version