Skip to content

fix: update _SERVICE_ACCOUNT_EMAIL_PATTERN to require .gserviceaccount.com suffix #17748

Merged
parthea merged 1 commit into
mainfrom
fix-service-account-email-pattern
Jul 21, 2026
Merged

fix: update _SERVICE_ACCOUNT_EMAIL_PATTERN to require .gserviceaccount.com suffix #17748
parthea merged 1 commit into
mainfrom
fix-service-account-email-pattern

Conversation

@macastelaz

Copy link
Copy Markdown
Contributor

Addresses issue where some environments provide something that is email-like but is NOT a service account email address when attempting to retrieve the compute SA

@macastelaz
macastelaz requested review from a team as code owners July 16, 2026 20:55

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the service account email validation pattern in the Google Compute Engine metadata module to restrict valid emails to those ending with ".gserviceaccount.com". The corresponding unit tests have been updated to reflect this change, asserting that standard email addresses like "test@example.com" are now considered invalid. There are no review comments, so no additional feedback is provided.

@macastelaz
macastelaz force-pushed the fix-service-account-email-pattern branch 4 times, most recently from ff2b6ba to 2f417f2 Compare July 16, 2026 21:06
@macastelaz macastelaz changed the title Update _SERVICE_ACCOUNT_EMAIL_PATTERN to require .gserviceaccount.com suffix fix: update _SERVICE_ACCOUNT_EMAIL_PATTERN to require .gserviceaccount.com suffix Jul 16, 2026
@macastelaz
macastelaz force-pushed the fix-service-account-email-pattern branch from 2f417f2 to 94a31f4 Compare July 16, 2026 21:21
@parthea parthea added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Jul 17, 2026
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Jul 17, 2026
@parthea
parthea merged commit b60bb04 into main Jul 21, 2026
40 checks passed
@parthea
parthea deleted the fix-service-account-email-pattern branch July 21, 2026 15:54
This was referenced Jul 21, 2026
suztomo added a commit that referenced this pull request Jul 21, 2026
🤖 I have created a release *beep* *boop*
---


##
[2.56.2](google-auth-v2.56.1...google-auth-v2.56.2)
(2026-07-21)


### Bug Fixes

* **auth:** centralize cert discovery logic and steps
([#17696](#17696))
([edc0423](edc0423))
* **auth:** exit early when agent cert config is outside well-known
directory
([#17762](#17762))
([61e795a](61e795a))
* **transport:** propagate mTLS adapter to auth session and fix
connection leaks
([#17689](#17689))
([8289d32](8289d32))
* update _SERVICE_ACCOUNT_EMAIL_PATTERN to require .gserviceaccount.com
suffix
([#17748](#17748))
([b60bb04](b60bb04))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

google-auth: Auth incorrectly identifies user emails as service accounts, triggering failing RAB lookups

4 participants