fix(storage): use OrderedDict while encoding POST policy#95
fix(storage): use OrderedDict while encoding POST policy#95frankyn merged 3 commits intogoogleapis:masterfrom
Conversation
| "expiration": policy_expires.isoformat() + "Z", | ||
| }.items() | ||
| ) | ||
| ), |
There was a problem hiding this comment.
expiration sometimes encoded before conditions - in such a cases tests are failing
There was a problem hiding this comment.
I'm a little concerned about imposing order in signing code given it's only used for conformance tests.
However, it doesn't change the outcome of expectation and will work as expected as a user.
| out_data = test_data["policyOutput"] | ||
|
|
||
| decoded_policy = base64.b64decode(fields["policy"]).decode("unicode_escape") | ||
| assert decoded_policy == out_data["expectedDecodedPolicy"] |
There was a problem hiding this comment.
Moved decoded_policy assert to the top: if something gone wrong in policy, it'll be easier to see it in decoded state - probably will save some time on debugging
|
@frankyn, kokoro failed in |
| "expiration": policy_expires.isoformat() + "Z", | ||
| }.items() | ||
| ) | ||
| ), |
There was a problem hiding this comment.
I'm a little concerned about imposing order in signing code given it's only used for conformance tests.
However, it doesn't change the outcome of expectation and will work as expected as a user.
* use OrderedDict() while encoding POST policy * fix(storage): use OrderedDict() while encoding POST policy
* use OrderedDict() while encoding POST policy * fix(storage): use OrderedDict() while encoding POST policy
Towards #64 (comment)
Sometimes policy losses it's order while encoding into JSON. Adding
OrderedDict()to fix this.