Skip to content

feat(auth): Skip RAB lookup if MDS returns a non-email.#8440

Merged
vverman merged 4 commits into
googleapis:regional-access-boundariesfrom
vverman:rab-skip-lookup-non-email-mds
Jun 10, 2026
Merged

feat(auth): Skip RAB lookup if MDS returns a non-email.#8440
vverman merged 4 commits into
googleapis:regional-access-boundariesfrom
vverman:rab-skip-lookup-non-email-mds

Conversation

@vverman

@vverman vverman commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

In computeclient.ts, the resolveServiceAccountEmail function could return a non-email.

In such cases, we skip RAB lookup, log the skip once for user and avoid making any future MDS calls.

Added tests for this.

@vverman vverman requested a review from a team as a code owner June 4, 2026 02:29

@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 getRegionalAccessBoundaryUrl method in the Compute client to validate the format of the service account email, returning null if it is invalid or missing. It also adds comprehensive unit tests to verify this behavior. The feedback suggests moving the regular expression definition to a module-level constant to avoid recreating it on every function call, which improves performance.

Comment thread core/packages/google-auth-library-nodejs/src/auth/computeclient.ts
@vverman vverman requested review from feywind and nbayati June 4, 2026 08:06
@vverman vverman merged commit f92809f into googleapis:regional-access-boundaries Jun 10, 2026
4 of 10 checks passed
feywind pushed a commit that referenced this pull request Jun 24, 2026
* feat: Regional Access Boundary Migration. (#8043)

* feat: Update Regional Access Boundaries (#8099)

* RAB endpoints changed from staging to prod; Removed RAB env variable gate; updated tests.

* removed sinon.createSandbox from nested beforeEach blocks in test.compute.ts, test.jwt.ts, and test.impersonated.ts.

* feat(auth): Skip RAB lookup if MDS returns a non-email. (#8440)

* feat(auth): Skip RAB lookup if MDS returns a non-email.

* Added logic to skip MDS calls in case non-email is returned. Added tests.

* Added email regex as a const.

* Simplified logic.

* Addressed comments.
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.

3 participants