-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
[storage] feat: add post policy sample #3231
Conversation
frankyn
commented
Mar 31, 2020
•
edited
Loading
edited
- merge and release: feature: V4 Post policies googleapis/python-storage#87
- Update test to pass.
- GCS review from @jkwlui
- Python review
|
||
def generate_signed_post_policy_v4(bucket_name, blob_name): | ||
"""Generates a v4 POST Policy and prints an HTML form.""" | ||
# bucket_name = 'your-bucket-name' |
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.
We do this in other samples also, but it seems odd to me that these aren't just documents in the docstring of the method. For instance https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/storage/cloud-client/storage_create_bucket.py#L25
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's the way we've done it for a while now but open to changing it. IIUC it's part of sample expectations for Python and was approved.
form = header.format(policy["url"]) | ||
|
||
# Include all fields returned in the HTML form as they're required | ||
for index, (key, value) in enumerate(policy["fields"].items()): |
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.
for key, value in policy["fields"].items():
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 nit, LGTM