GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: make v4 signing formatting consistent w/ spec by tseaver · Pull Request #56 · googleapis/python-storage

This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Conversation

@tseaver

@tseaver tseaver commented Feb 12, 2020

Copy link
Copy Markdown
Contributor

Fixes #12

W/ exception of query string parameter quoting bits being addressed in PR #48.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
tseaver added 4 commits February 12, 2020 13:53
@tseaver
refactor: rename 'canonicalize' to show V2 only
720f484
Prep for review / update of *V4* canonicalization.
@tseaver
refactor: simplify header ws normalization
799bb01
@tseaver
fix: ensure URI quoting of resource path
6cc5f8a
@tseaver
fix: sign user-supplied payload hash
97a26c7
@tseaver tseaver added the api: storage Issues related to the googleapis/python-storage API. label Feb 12, 2020
@tseaver
tseaver requested review from crwilcox and frankyn February 12, 2020 19:49
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 12, 2020
frankyn
frankyn suggested changes Feb 12, 2020
View reviewed changes

@frankyn frankyn left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I have one nit overall LGTM, thanks @tseaver.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread google/cloud/storage/_signing.py Outdated

if "x-goog-content-sha256" in lowercased_headers:
payload = lowercased_headers["x-goog-content-sha256"]
elif "x-amz-content-sha256" in lowercased_headers:

@frankyn frankyn Feb 12, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Only support x-goog- and ignore x-amz.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tseaver
fix: drop support for 'x-amz-content-sha256'
a16c8cc
Per review from @frankyn
frankyn
frankyn suggested changes Feb 12, 2020
View reviewed changes

@frankyn frankyn left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

One question, but overall LGTM. Thanks @tseaver

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread tests/unit/test__signing.py Outdated
self.assertEqual(scheme, expected_scheme)
self.assertEqual(netloc, expected_netloc)
self.assertEqual(path, resource)
self.assertEqual(path, six.moves.urllib.parse.quote(resource))

@frankyn frankyn Feb 12, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Does this encode '/' as well? It should not.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@tseaver tseaver Feb 12, 2020

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

It does not: it is actually designed to quote the path part.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@frankyn frankyn Feb 12, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This might hit an issue with conformance tests when that's added but approving for now.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@tseaver tseaver Feb 13, 2020

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

As it happens, I backed it out here, because the bucket / blob already do the urlencoding of the resource before calling _sigining.generate_signed_url_v4.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
frankyn
frankyn approved these changes Feb 12, 2020
View reviewed changes

@frankyn frankyn left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
tseaver added 2 commits February 12, 2020 16:51
@tseaver
fix: revert "fix: ensure URI quoting of resource path"
eba4239
The caller already URL-encodes the 'resource' path. and so we
don't want to do it here.

Reverts commit 6cc5f8a.
@tseaver
Merge branch 'master' into 12-fix-v4-signing-formatting
cff7e49
@tseaver tseaver mentioned this pull request Feb 12, 2020
Update shared conformance tests #57
Closed
@tseaver
Merge branch 'master' into 12-fix-v4-signing-formatting
25f0780
@tseaver tseaver added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 13, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 13, 2020
@tseaver
tseaver merged commit 8712da8 into master Feb 13, 2020
@yoshi-automation yoshi-automation mentioned this pull request Feb 19, 2020
chore: update to latest black (via synth) #65
Merged
@tseaver
tseaver deleted the 12-fix-v4-signing-formatting branch August 24, 2021 18:07
cojenco pushed a commit to cojenco/python-storage that referenced this pull request Oct 13, 2021
@tseaver @cojenco
fix: make v4 signing formatting consistent w/ spec (googleapis#56)
4118043
* Rename 'canonicalize' to show V2 only.
* Refactor / simplify header whitespace normalization.
* Sign user-supplied payload hash.
cojenco pushed a commit to cojenco/python-storage that referenced this pull request Oct 13, 2021
@tseaver @cojenco
fix: make v4 signing formatting consistent w/ spec (googleapis#56)
26eba90
* Rename 'canonicalize' to show V2 only.
* Refactor / simplify header whitespace normalization.
* Sign user-supplied payload hash.
@release-please release-please Bot mentioned this pull request Jan 12, 2022
chore(main): release 3.0.0 #688
Closed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@crwilcox crwilcox Awaiting requested review from crwilcox
1 more reviewer
@frankyn frankyn frankyn approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

api: storage Issues related to the googleapis/python-storage API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[Storage] V4 Signature: Formatting Inconsistencies

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@tseaver @frankyn @googlebot @yoshi-kokoro
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.