Skip to content

feat: add conformance test for content-* fields#37

Merged
frankyn merged 2 commits intomasterfrom
increase-storage-conf
Sep 14, 2020
Merged

feat: add conformance test for content-* fields#37
frankyn merged 2 commits intomasterfrom
increase-storage-conf

Conversation

@frankyn
Copy link
Copy Markdown
Contributor

@frankyn frankyn commented Sep 14, 2020

fixes: #36

@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Sep 14, 2020
@frankyn frankyn marked this pull request as ready for review September 14, 2020 07:19
@frankyn frankyn requested a review from tritone September 14, 2020 07:20
Copy link
Copy Markdown
Contributor

@tritone tritone left a comment

Choose a reason for hiding this comment

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

Thanks for adding this!

I guess we merge this here and then update all the repos manually?

@frankyn
Copy link
Copy Markdown
Contributor Author

frankyn commented Sep 14, 2020

That's correct, we will need to address the gap in all languages.

Pending review from @houglum

@frankyn frankyn added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Sep 14, 2020
@quartzmo
Copy link
Copy Markdown
Member

Just FYI, I copied this change into google-cloud-ruby and get the following failures. Hopefully they look correct:

# Running:

test_signer_v4_10: POST Policy With Additional Metadata:
policyOutput

expectedDecodedPolicy:

{"conditions":[{"content-disposition":"attachment"},{"content-encoding":"gzip"},{"content-type":"text/plain"},{"success_action_redirect":"http://www.google.com/"},{"bucket":"rsaposttest-1579902671-6ldm6caw4se52vrx"},{"key":"test-object"},{"x-goog-date":"20200123T043530Z"},{"x-goog-credential":"test-iam-credentials@dummy-project-id.iam.gserviceaccount.com/20200123/auto/storage/goog4_request"},{"x-goog-algorithm":"GOOG4-RSA-SHA256"}],"expiration":"2020-01-23T04:35:40Z"}

test_bucket_10: POST Policy With Additional Metadata:
policyOutput

expectedDecodedPolicy:

{"conditions":[{"content-disposition":"attachment"},{"content-encoding":"gzip"},{"content-type":"text/plain"},{"success_action_redirect":"http://www.google.com/"},{"bucket":"rsaposttest-1579902671-6ldm6caw4se52vrx"},{"key":"test-object"},{"x-goog-date":"20200123T043530Z"},{"x-goog-credential":"test-iam-credentials@dummy-project-id.iam.gserviceaccount.com/20200123/auto/storage/goog4_request"},{"x-goog-algorithm":"GOOG4-RSA-SHA256"}],"expiration":"2020-01-23T04:35:40Z"}

Finished in 1.073564s, 857.8902 runs/s, 2496.3579 assertions/s.

  1) Failure:
PostObjectConformanceTest#test_signer_v4_10: POST Policy With Additional Metadata [/Users/quartzmo/code/google/codez/google-cloud-ruby/google-cloud-storage/test/google/cloud/storage/file/signer_v4/post_object_conformance_test.rb:54]:
--- expected
+++ actual
@@ -1 +1 @@
-["key", "policy", "success_action_redirect", "x-goog-algorithm", "x-goog-credential", "x-goog-date", "x-goog-signature"]
+["content-disposition", "content-encoding", "content-type", "key", "policy", "success_action_redirect", "x-goog-algorithm", "x-goog-credential", "x-goog-date", "x-goog-signature"]


  2) Failure:
PostObjectConformanceTest#test_bucket_10: POST Policy With Additional Metadata [/Users/quartzmo/code/google/codez/google-cloud-ruby/google-cloud-storage/test/google/cloud/storage/file/signer_v4/post_object_conformance_test.rb:91]:
--- expected
+++ actual
@@ -1 +1 @@
-["key", "policy", "success_action_redirect", "x-goog-algorithm", "x-goog-credential", "x-goog-date", "x-goog-signature"]
+["content-disposition", "content-encoding", "content-type", "key", "policy", "success_action_redirect", "x-goog-algorithm", "x-goog-credential", "x-goog-date", "x-goog-signature"]

@frankyn
Copy link
Copy Markdown
Contributor Author

frankyn commented Sep 14, 2020

Thanks @quartzmo, could you take a look at the updated version?

@quartzmo
Copy link
Copy Markdown
Member

@frankyn The tests pass now after your latest commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement. do not merge Indicates a pull request not ready for merge, due to either quality or timing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Storage V4 Post Policy conformance is missing test for content-* fields.

4 participants