- Notifications
You must be signed in to change notification settings - Fork166
docs: add docs signed_url expiration take default utc#250
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
tseaver left a comment
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.
Please change all the docstrings as noted in my first comment.
google/cloud/storage/_signing.py Outdated
| :param expiration: Point in time when the signed URL should expire. | ||
| :param expiration: Point in time when the signed URL should expire. If | ||
| expiration in datetime, then need to pass timezone | ||
| with it. Default value of ``tzinfo`` is ``UTC``. |
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.
The default value of thetzinfo argument todatetime.datetime is None, resulting in a "naive"datetime instance: the comment should state clearly that we forcibly convert such instances toUTC. E.g.:
:paramexpiration:PointintimewhenthesignedURLshouldexpire.Ifa`datetime`instanceispassedwithoutanexplicit`tzinfo`set,itwillbeconvertedto``UTC``.
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.
Rather than "it will be converted to" let's use "it will be assumed to be". This is a huge footgun; a user who sees the term "converted" will assume that we will do the right thing in the default case, whereas in fact we will almost always do the wrong thing.
andrewsg left a comment
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 per the original issue, can we also modify the system test TestV4POSTPolicies.test_get_signed_policy_v4() to use utcnow()?
andrewsg commentedAug 24, 2020
Cancel that, I just saw that the test issue is resolved in#251. Thanks for that! Leaving review on "changes requested" for the docstring update as per my comment; lgtm other than that. |
andrewsg left a comment
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.
Thanks!
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
tseaver commentedAug 26, 2020
@HemangChothani I would merge my suggestions to address the concern expressed by@andrewsg , but you have the "maintainers can push changes" option turned off. |
…into storage_issue_244
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Frank Natividad <frankyn@users.noreply.github.com>Co-authored-by: Tres Seaver <tseaver@palladion.com>
Co-authored-by: Frank Natividad <frankyn@users.noreply.github.com>Co-authored-by: Tres Seaver <tseaver@palladion.com>
Fixes#244