This repository was archived by the owner on Mar 6, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ class _RegionalAccessBoundaryRefreshThread(threading.Thread):
2222
2323 def __init__ (self , credentials , request ):
2424 super (_RegionalAccessBoundaryRefreshThread , self ).__init__ ()
25+ self .daemon = True
2526 self ._credentials = credentials
2627 self ._request = request
2728
@@ -63,15 +64,16 @@ def run(self):
6364 _LOGGER .warning (
6465 "Asynchronous Regional Access Boundary lookup failed. Entering cooldown."
6566 )
67+ self ._credentials ._regional_access_boundary_cooldown_expiry = (
68+ _helpers .utcnow ()
69+ + self ._credentials ._current_rab_cooldown_duration
70+ )
6671 new_cooldown_duration = (
6772 self ._credentials ._current_rab_cooldown_duration * 2
6873 )
6974 self ._credentials ._current_rab_cooldown_duration = min (
7075 new_cooldown_duration , MAX_REGIONAL_ACCESS_BOUNDARY_COOLDOWN
7176 )
72- self ._credentials ._regional_access_boundary_cooldown_expiry = (
73- _helpers .utcnow () + self ._credentials ._current_rab_cooldown_duration
74- )
7577 # If the proactive refresh failed, clear any existing expired RAB data.
7678 # This ensures we don't continue using stale data.
7779 self ._credentials ._regional_access_boundary = None
Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ def _build_regional_access_boundary_lookup_url(self):
172172
173173 return (
174174 _constants ._SERVICE_ACCOUNT_REGIONAL_ACCESS_BOUNDARY_LOOKUP_ENDPOINT .format (
175- self .service_account_email
175+ service_account_email = self .service_account_email
176176 )
177177 )
178178
Original file line number Diff line number Diff line change @@ -545,10 +545,6 @@ def _build_regional_access_boundary_lookup_url(self):
545545 )
546546
547547
548- # For backward compatibility.
549- CredentialsWithTrustBoundary = CredentialsWithRegionalAccessBoundary
550-
551-
552548class AnonymousCredentials (Credentials ):
553549 """Credentials that do not provide any authentication information.
554550
Original file line number Diff line number Diff line change 3939from google .auth import iam
4040from google .auth import jwt
4141from google .auth import metrics
42+ from google .auth import _constants
4243from google .oauth2 import _client
4344
4445import logging
5051_DEFAULT_TOKEN_LIFETIME_SECS = 3600 # 1 hour in seconds
5152
5253_GOOGLE_OAUTH2_TOKEN_ENDPOINT = "https://oauth2.googleapis.com/token"
53- _REGIONAL_ACCESS_BOUNDARY_LOOKUP_ENDPOINT = (
54- "https://iamcredentials.{}/v1/projects/-/serviceAccounts/{}/allowedLocations"
55- )
54+
5655
5756_SOURCE_CREDENTIAL_AUTHORIZED_USER_TYPE = "authorized_user"
5857_SOURCE_CREDENTIAL_SERVICE_ACCOUNT_TYPE = "service_account"
@@ -361,8 +360,8 @@ def _build_regional_access_boundary_lookup_url(self):
361360 "Service account email is required to build the Regional Access Boundary lookup URL for impersonated credentials."
362361 )
363362 return None
364- return _REGIONAL_ACCESS_BOUNDARY_LOOKUP_ENDPOINT .format (
365- self . universe_domain , self .service_account_email
363+ return _constants . _SERVICE_ACCOUNT_REGIONAL_ACCESS_BOUNDARY_LOOKUP_ENDPOINT .format (
364+ service_account_email = self .service_account_email
366365 )
367366
368367 def sign_bytes (self , message ):
You can’t perform that action at this time.
0 commit comments