Skip to content

fix: Accepting time-zone aware expiration datetime only to prevent hard-to debug issues with invalid signatures #12704

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

Conversation

pawelkedzior-gl
Copy link
Contributor

@pawelkedzior-gl pawelkedzior-gl commented Oct 17, 2024

Description

Fixes #12692

Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.

Checklist

pytest
(...)
snippets_test.py::test_sign_url PASSED                                                                                                                                                                                                                                            [ 16%]
snippets_test.py::test_sign_url_raise_exception_on_naive_expiration_datetime PASSED                                                                                                                                                                                               [ 33%]
snippets_test.py::test_sign_url_prefix PASSED                                                                                                                                                                                                                                     [ 50%]
snippets_test.py::test_sign_url_prefix_raise_exception_on_naive_expiration_datetime PASSED                                                                                                                                                                                        [ 66%]
snippets_test.py::test_sign_cookie PASSED                                                                                                                                                                                                                                         [ 83%]
snippets_test.py::test_sign_cookie_raise_exception_on_naive_expiration_datetime PASSED
cp ../noxfile-template.py noxfile.py
nox -s lint
nox > Running session lint
nox > Creating virtual environment (virtualenv) using python3 in .nox/lint
nox > python -m pip install flake8 flake8-import-order
nox > flake8 --show-source --builtin=gettext --max-complexity=20 --import-order-style=google '--exclude=.nox,.cache,env,lib,generated_pb2,*_pb2.py,*_pb2_grpc.py' --ignore=ANN101,ANN102,E121,E123,E126,E203,E226,E24,E266,E501,E704,W503,W504,I202 --max-line-length=88 --application-import-names .nox,env,noxfile,snippets,snippets_test .
nox > Session lint was successful.
  • [no] These samples need a new API enabled in testing projects to pass (let us know which ones)
  • [no] These samples need a new/updated env vars in testing projects set to pass (let us know which ones)
  • [no] This sample adds a new sample directory, and I updated the CODEOWNERS file with the codeowners for this sample
  • [no] This sample adds a new Product API, and I updated the Blunderbuss issue/PR auto-assigner with the codeowners for this sample
  • [yes] Please merge this PR for me once it is approved

@m-strzelczyk m-strzelczyk added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 17, 2024
@kokoro-team kokoro-team removed kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Oct 17, 2024
@glasnt glasnt added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 17, 2024
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 17, 2024
@glasnt glasnt changed the title Cloud cdn datetime fixes fix: Accepting time-zone aware expiration datetime only to prevent hard-to debug issues with invalid signatures Oct 17, 2024
@glasnt
Copy link
Contributor

glasnt commented Oct 17, 2024

Pending CI, this looks correct. Will approve once Kokoro agrees.

@glasnt glasnt merged commit 2844ce9 into GoogleCloudPlatform:main Oct 18, 2024
11 checks passed
jacspa96 pushed a commit to jacspa96/python-docs-samples that referenced this pull request Oct 30, 2024
…rd-to debug issues with invalid signatures (GoogleCloudPlatform#12704)

* Accepting time-zone aware expiration datetime only to prevent hard-to debug issues with invalid signatures.

* Applying code review suggestion

* Fixing linter issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cloud CDN Singed Urls and Signed Cookies examples use time-zone unaware datetime objects
4 participants