Skip to content

Conversation

nbayati
Copy link
Contributor

@nbayati nbayati commented Aug 22, 2025

Implements the trust boundary feature for external accounts (workforce and workload pool identity, and also authorized user)
Note: The design has changed since the first PR that implemented trust boundary for service accounts, and we are no longer required to send the allowed locations header to IAM or STS requests, only to the google API calls. You can review the most up to date design here: go/trust-boundaries-auth-sdk-v2

@nbayati nbayati requested review from a team as code owners August 22, 2025 22:23
@nbayati nbayati requested review from sai-sunder-s and lsirac August 22, 2025 23:04
@nbayati nbayati requested a review from a team as a code owner August 26, 2025 21:38

def test_build_trust_boundary_lookup_url(self):
credentials = self.make_credentials()
expected_url = "https://iamcredentials.googleapis.com/v1/locations/global/workforcePools/POOL_ID/allowedLocations"
Copy link
Contributor

Choose a reason for hiding this comment

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

Add few more cases:

  • rep instead of global
  • different universe

assert credentials._build_trust_boundary_lookup_url() == expected_url

def test_build_trust_boundary_lookup_url_invalid_audience(self):
credentials = self.make_credentials(audience="invalid")
Copy link
Contributor

Choose a reason for hiding this comment

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

add cases with real looking url but not have expected pattern

@@ -278,7 +278,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(request)
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.

why do we need to get the turst boundary locations for source cred? It will be the outer (impersonated) cred that will be adding the headers for the API calls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants