Repository navigation
Conversation
…service_account refresh
Contributor
There was a problem hiding this comment.
Code Review
This pull request aligns the asynchronous service account credentials refresh logic with the synchronous implementation by attempting to refresh self-signed JWT credentials before falling back to the OAuth 2.0 assertion grant. It extracts this logic into a helper method, fixes an initialization bug where the local variable was checked instead of the instance variable, and adds comprehensive unit tests for both synchronous and asynchronous flows. There are no review comments to address, so I have no additional feedback to provide.
This was referenced Nov 30, 2026
Open
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
service_account.Credentials.__init__to compareself._universe_domain(rather than the rawuniverse_domainargument) againstDEFAULT_UNIVERSE_DOMAINsouniverse_domain=Nonedoes not inadvertently enable_always_use_jwt_access._try_refresh_self_signed_jwt()onservice_account.Credentialsand raiseRefreshErrorwhen refreshing non-default universe credentials without scopes or an audience, instead of falling through to the OAuth 2.0 assertion grant._try_refresh_self_signed_jwt()in_service_account_async.Credentials.refresh()so async service account credentials match the sync self-signed JWT and non-default universe refresh behavior.