Skip to content
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

fix: allow signed url version v4 without signed credentials #356

Merged
merged 9 commits into from Feb 19, 2021

Conversation

guillaumeblaquiere
Copy link
Contributor

Fixes #355 🦕

I used the service_account_email passed in method parameter as "signer" instead of taking it in the credentials.signer_email method. That allows to not use google.auth.credentials.Signing type as credential parameter and to use the Service Account credential API instead.

I preserved the checks in case of access_token or service_account_email set to nil, to preserve the efficiency and the existing behavior.


I also updated tests. Successful with python 3.8.

Open to comment and to improve this PR if needed

…e checks for efficiency in case of neither access_token nor service_account_email are provided.

Fix: tests v4 with token to take into account not Signing credential class.
@guillaumeblaquiere guillaumeblaquiere requested a review from a team January 4, 2021 22:03
@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/python-storage API. label Jan 4, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jan 4, 2021
@guillaumeblaquiere guillaumeblaquiere changed the title Fix #355: allow signed url version v4 without service account email fix: allow signed url version v4 without service account email Jan 4, 2021
google/cloud/storage/_signing.py Show resolved Hide resolved
tests/unit/test__signing.py Outdated Show resolved Hide resolved
@tseaver tseaver added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 20, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 20, 2021
@tseaver tseaver changed the title fix: allow signed url version v4 without service account email fix: allow signed url version v4 without signed credentials Jan 20, 2021
@cajoek
Copy link

cajoek commented Jan 21, 2021

I really want this!

@guillaumeblaquiere
Copy link
Contributor Author

Sorry for the delay, the week was awful!

@guillaumeblaquiere
Copy link
Contributor Author

@tseaver any review possible on this?

@frankyn frankyn requested a review from a team as a code owner February 18, 2021 18:24
Copy link
Member

@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 @guillaumeblaquiere LGTM

@frankyn frankyn added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 18, 2021
@frankyn frankyn requested a review from tseaver February 18, 2021 18:28
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 18, 2021
@frankyn frankyn added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 19, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 19, 2021
@frankyn frankyn dismissed tseaver’s stale review February 19, 2021 21:58

Feedback has been addressed

@frankyn frankyn merged commit 3e69bf9 into googleapis:master Feb 19, 2021
cojenco pushed a commit to cojenco/python-storage that referenced this pull request Oct 13, 2021
…is#356)

* Fix: signed_url_v4 to accept credentials without private key. Preserve checks for efficiency in case of neither access_token nor service_account_email are provided.
Fix: tests v4 with token to take into account not Signing credential class.

* fix typo: 2 new lines before new test class

* fix doc: Improve docstring to explain the use of the access_token AND the service_account_email, or the signer email.

* fix: test coverage with the new IF branch

* lint

Co-authored-by: Tres Seaver <tseaver@palladion.com>
Co-authored-by: Frank Natividad <frankyn@users.noreply.github.com>
Co-authored-by: Frank Natividad <franknatividad@google.com>
cojenco pushed a commit to cojenco/python-storage that referenced this pull request Oct 13, 2021
…is#356)

* Fix: signed_url_v4 to accept credentials without private key. Preserve checks for efficiency in case of neither access_token nor service_account_email are provided.
Fix: tests v4 with token to take into account not Signing credential class.

* fix typo: 2 new lines before new test class

* fix doc: Improve docstring to explain the use of the access_token AND the service_account_email, or the signer email.

* fix: test coverage with the new IF branch

* lint

Co-authored-by: Tres Seaver <tseaver@palladion.com>
Co-authored-by: Frank Natividad <frankyn@users.noreply.github.com>
Co-authored-by: Frank Natividad <franknatividad@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/python-storage API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Impossible to use signed url v4 and the Service Account Credential APIs
5 participants