GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — refactor: split 'with_quota_project' into separate base class by busunkim96 · Pull Request #561 · googleapis/google-auth-library-python

This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Conversation

@busunkim96

@busunkim96 busunkim96 commented Jul 15, 2020

Copy link
Copy Markdown
Contributor

#546 (comment)

Isn't this a breaking change? Should it have been released as 1.19.0?

We are already seeing test failures in downstream libs like firebase-admin where we extend this interface.

firebase_admin/db.py:983:0: W0223: Method 'with_quota_project' is abstract in class 'Credentials' but is not overridden (abstract-method)

#546 (comment)

Actually this seems to be because pylint considers any method in an abstract class that throws NotImplementedError to be abstract: http://pylint-messages.wikidot.com/messages:w0223

Not quite sure if that should be considered a breaking change, or write it off as pylint being too pedantic.

CC @hiranya911

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Jul 15, 2020
@tseaver

tseaver commented Jul 21, 2020

Copy link
Copy Markdown
Contributor

FWIW, the NotImplementedError in the abstract base class could be considered "correct", as it adds a contract that all concrete subclasses must implement. For better backward-compatibility, it might be better to add another abstract class with that method, rather than changing it to raise ValueError. E.g.:

class CredentialsWithQuotaProject(Credentials):
    @abc.abstractmethod
    def with_quota_project(self, quota_project_id):
        """Returns a copy of these credentials with a modified quota project
        Args:
            quota_project_id (str): The project to use for quota and
                billing purposes
        Returns:
            google.oauth2.credentials.Credentials: A new credentials instance.
        """
        raise NotImplementedError("This class does not support quota project.")
busunkim96 and hiranya911 reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@busunkim96 busunkim96 closed this Jul 31, 2020
@busunkim96 busunkim96 reopened this Jul 31, 2020
@hiranya911

hiranya911 commented Aug 26, 2020

Copy link
Copy Markdown
Contributor

Any plans to implement the change suggested by @tseaver? This is currently causing a failure in our CI system. I'm thinking of adding a lint ignore directive for now.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hiranya911 hiranya911 mentioned this pull request Aug 26, 2020
chore: Temporarily disabling a lint rule firebase/firebase-admin-python#485
Merged
@busunkim96 @tseaver
fix: raise ValueError for with_quota_project
053d3b5
@google-cla

google-cla Bot commented Aug 27, 2020

Copy link
Copy Markdown

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@google-cla google-cla Bot added cla: no This human has *not* signed the Contributor License Agreement. and removed cla: yes This human has signed the Contributor License Agreement. labels Aug 27, 2020
@tseaver

tseaver commented Aug 27, 2020

Copy link
Copy Markdown
Contributor

@google-cla I consent.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tseaver tseaver added the kokoro:run Add this label to force Kokoro to re-run the tests. label Aug 27, 2020
@tseaver
tseaver force-pushed the quota-project-value-error branch from 702cb2f to 053d3b5 Compare August 27, 2020 16:35
@google-cla google-cla Bot added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Aug 27, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Aug 27, 2020
@tseaver
refactor: split 'with_quota_project' into separate base class
dc3ae79
@google-cla

google-cla Bot commented Aug 27, 2020

Copy link
Copy Markdown

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@google-cla google-cla Bot added cla: no This human has *not* signed the Contributor License Agreement. and removed cla: yes This human has signed the Contributor License Agreement. labels Aug 27, 2020
@tseaver

tseaver commented Aug 27, 2020

Copy link
Copy Markdown
Contributor

@google-cla I consent

@busunkim96 I've pushed dc3ae79 with my suggested refactoring. I don't know why the CLA bot is unhappy with that commit. If you don't like how that looks, feel free to rebase my commit away.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tseaver

tseaver commented Aug 27, 2020

Copy link
Copy Markdown
Contributor

@googlebot I consent.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@google-cla google-cla Bot added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Aug 27, 2020
@busunkim96
Merge branch 'master' into quota-project-value-error
eda1d47
@busunkim96

busunkim96 commented Aug 31, 2020

Copy link
Copy Markdown
Contributor Author

@tseaver Thank you! 🙏

hiranya911 reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@busunkim96
busunkim96 requested review from arithmetic1728 and software-dov August 31, 2020 15:53
arithmetic1728
arithmetic1728 approved these changes Aug 31, 2020
View reviewed changes
@tseaver tseaver changed the title fix: make with_quota_project raise ValueError instead of NotImplementedError refactor: split 'with_quota_project' into separate base class Sep 2, 2020
@tseaver
tseaver merged commit 41599ae into master Sep 2, 2020
@tseaver
tseaver deleted the quota-project-value-error branch September 2, 2020 18:55
@arithmetic1728 arithmetic1728 mentioned this pull request Sep 3, 2020
fix: trigger an auto release #597
Merged
busunkim96 pushed a commit that referenced this pull request Sep 10, 2020
@bojeil-google
feat: implements the OAuth token exchange spec based on rfc8693 (#598)
1b45700
* refactor: split 'with_quota_project' into separate base class (#561)
* feat: implements the OAuth token exchange spec based on rfc8693
@tswast tswast mentioned this pull request Sep 16, 2020
test: update mock credentials to allow for quota projects googleapis/python-cloud-core#29
Merged
crwilcox added a commit that referenced this pull request Sep 25, 2020
@crwilcox
refactor: port #561 split 'with_quota_project' into separate base class
072283e
busunkim96 added a commit that referenced this pull request Oct 22, 2020
@bojeil-google @busunkim96
@tseaver @arithmetic1728 @release-please @wescpy @crwilcox @anibadde @akx
chore: sync to master (#628)
cae69d5
* refactor: split 'with_quota_project' into separate base class (#561)

Co-authored-by: Tres Seaver <[email protected]>

* fix: dummy commit to trigger a auto release (#597)

* chore: release 1.21.1 (#599)

* chore: updated CHANGELOG.md [ci skip]

* chore: updated setup.cfg [ci skip]

* chore: updated setup.py

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>

* fix: migrate signBlob to iamcredentials.googleapis.com (#600)

Migrate signBlob from iam.googleapis.com to iamcredentials.googleapis.com.

This API is deprecated and will be shutdown in one year.

This is used google.auth.iam.Signer.
Added a system_test to sanity check the implementation.

* chore: release 1.21.2 (#601)

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>

* fix: fix expiry for `to_json()` (#589)

* This patch for </issues/501> includes the following fixes:

- The access token is always set to `None`, so the fix involves using (the access) `token` from the saved JSON credentials file.
- For refresh needs, `expiry` also needs to be saved via `to_json()`.
    - DUMP: As `expiry` is a `datetime.datetime` object, serialize to `datetime.isoformat()` in the same [`oauth2client` format](https://github.com/googleapis/oauth2client/blob/master/oauth2client/client.py#L55) for consistency.
    - LOAD: Add code to restore `expiry` back to `datetime.datetime` object when imported.
    - LOAD: If `expiry` was unsaved, automatically set it as expired so refresh takes place.
- Minor `scopes` updates
    - DUMP: Add property for `scopes` so `to_json()` can grab it
    - LOAD: `scopes` may be saved as a string instead of a JSON array (Python list), so ensure it is Sequence[str] when imported.

* chore: add default CODEOWNERS (#609)

* chore: release 1.21.3 (#607)

* feat: add asyncio based auth flow (#612)

* feat: asyncio http request logic and asynchronous credentials logic  (#572)

Co-authored-by: Anirudh Baddepudi <[email protected]>

* chore: release 1.22.0 (#615)

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>

* fix: move aiohttp to extra as it is currently internal surface (#619)

Fix #618. Removes aiohttp from required dependencies to lessen dependency tree for google-auth.

This will need to be looked at again as more folks use aiohttp and once the surfaces goes to public visibility.

* chore: release 1.22.1 (#620)

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>

* fix: remove checks for ancient versions of Cryptography (#596)

Refs #595 (comment) 

I see no point in checking whether someone is running a version of https://github.com/pyca/cryptography/ from 2014 that doesn't even compile against modern versions of OpenSSL anymore.

* chore: sync to master

Syncs to master.
Fixes broken unit tests in Python 3.6 and 3.7.
Aligns test_identity_pool.py with test_aws.py.

Co-authored-by: Bu Sun Kim <[email protected]>
Co-authored-by: Tres Seaver <[email protected]>
Co-authored-by: arithmetic1728 <[email protected]>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: wesley chun <[email protected]>
Co-authored-by: Christopher Wilcox <[email protected]>
Co-authored-by: Anirudh Baddepudi <[email protected]>
Co-authored-by: Aarni Koskela <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@software-dov software-dov Awaiting requested review from software-dov
1 more reviewer
@arithmetic1728 arithmetic1728 arithmetic1728 approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@busunkim96 @tseaver @hiranya911 @arithmetic1728 @yoshi-kokoro
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.