Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

feat(storage): Add snippets for v4 signed URLs #2142

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

Merged
merged 7 commits into from
May 10, 2019
Merged

Conversation

jkwlui
Copy link
Collaborator

@jkwlui jkwlui commented May 7, 2019

No description provided.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label May 7, 2019
@jkwlui jkwlui self-assigned this May 7, 2019
@jkwlui jkwlui requested a review from frankyn May 7, 2019 00:35
Copy link
Contributor

@frankyn frankyn left a comment

Choose a reason for hiding this comment

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

Thanks @jkwlui, I never clicked "submit review", apologies for the delay.

print("curl -X PUT -H 'Content-Type: application/octet-stream' "
"--upload-file my-file \'{}\''.format(url)")
return url
# [END storage_generate_signed_url_v4]
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: storage_generate_upload_signed_url_v4

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good catch! thanks!

@@ -350,6 +406,14 @@ def copy_blob(bucket_name, blob_name, new_bucket_name, new_blob_name):
'signed-url', help=generate_signed_url.__doc__)
signed_url_parser.add_argument('blob_name')

signed_url_download_v4_parser = subparsers.add_parser(
Copy link
Contributor

Choose a reason for hiding this comment

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

Calling the generate signed URL should be added to the switch statement below.

print(url)
print('You can use this URL with any user agent, for example:')
print("curl -X PUT -H 'Content-Type: application/octet-stream' "
"--upload-file my-file \'{}\''.format(url)")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this line will have issues with format() as it's part of the double quoted string.

@jkwlui
Copy link
Collaborator Author

jkwlui commented May 8, 2019

./snippets.py:355:1: C901 'If 355' is too complex (21)

not sure how to fix this..

@frankyn
Copy link
Contributor

frankyn commented May 8, 2019

Reading more on it here: https://lintlyci.github.io/Flake8Rules/rules/C901.html

@engelke do you have any tips on this?

@engelke
Copy link
Contributor

engelke commented May 8, 2019 via email

@jkwlui
Copy link
Collaborator Author

jkwlui commented May 9, 2019

Looks like it's passing now :)

@jkwlui jkwlui requested a review from frankyn May 9, 2019 17:35
@frankyn
Copy link
Contributor

frankyn commented May 9, 2019

Thanks @jkwlui!

@jkwlui jkwlui merged commit b4b6816 into master May 10, 2019
@jkwlui jkwlui deleted the v4-signed-url-snippets branch May 10, 2019 18:50
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.