This repository was archived by the owner on Mar 6, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
google/auth/compute_engine Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828from google .auth import jwt
2929from google .auth import metrics
3030from google .auth .compute_engine import _metadata
31- from google .auth .transport import requests as google_auth_requests
3231from google .oauth2 import _client
3332
3433
@@ -84,7 +83,6 @@ def __init__(
8483 self ._scopes = scopes
8584 self ._default_scopes = default_scopes
8685 self ._universe_domain_cached = False
87- self ._universe_domain_request = google_auth_requests .Request ()
8886 if universe_domain :
8987 self ._universe_domain = universe_domain
9088 self ._universe_domain_cached = True
@@ -150,8 +148,11 @@ def requires_scopes(self):
150148 def universe_domain (self ):
151149 if self ._universe_domain_cached :
152150 return self ._universe_domain
151+
152+ from google .auth .transport import requests as google_auth_requests
153+
153154 self ._universe_domain = _metadata .get_universe_domain (
154- self . _universe_domain_request
155+ google_auth_requests . Request ()
155156 )
156157 self ._universe_domain_cached = True
157158 return self ._universe_domain
Original file line number Diff line number Diff line change @@ -257,16 +257,12 @@ def test_universe_domain(self, get_universe_domain):
257257 assert self .credentials .universe_domain == "fake_universe_domain"
258258 assert self .credentials ._universe_domain == "fake_universe_domain"
259259 assert self .credentials ._universe_domain_cached
260- get_universe_domain .assert_called_once_with (
261- self .credentials ._universe_domain_request
262- )
260+ get_universe_domain .assert_called_once ()
263261
264262 # calling the universe_domain property the second time should use the
265263 # cached value instead of calling get_universe_domain
266264 assert self .credentials .universe_domain == "fake_universe_domain"
267- get_universe_domain .assert_called_once_with (
268- self .credentials ._universe_domain_request
269- )
265+ get_universe_domain .assert_called_once ()
270266
271267 @mock .patch ("google.auth.compute_engine._metadata.get_universe_domain" )
272268 def test_user_provided_universe_domain (self , get_universe_domain ):
You can’t perform that action at this time.
0 commit comments