Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion google/auth/impersonated_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def _refresh_token(self, request):
self._source_credentials.token_state == credentials.TokenState.STALE
or self._source_credentials.token_state == credentials.TokenState.INVALID
):
self._source_credentials._refresh_token(request)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The previous implementation relied on the private _refresh_token method of _source_credentials. This could lead to issues with custom credential types that do not expose this private method, resulting in AttributeError or unexpected behavior. Using the public refresh method, as introduced in this change, ensures adherence to the public API contract and improves compatibility across various credential implementations.

Suggested change
self._source_credentials._refresh_token(request)
self._source_credentials.refresh(request)

self._source_credentials.refresh(request)

body = {
"delegates": self._delegates,
Expand Down