Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

feat: allow users to call default service account endpoint if no email is passed#1687

Closed
harkamaljot wants to merge 6 commits intomainfrom
default-service-account-endpoint
Closed

feat: allow users to call default service account endpoint if no email is passed#1687
harkamaljot wants to merge 6 commits intomainfrom
default-service-account-endpoint

Conversation

@harkamaljot
Copy link
Copy Markdown
Contributor

Currently, when we always fetch the email from the mds server and use that email to make an rpc call to mds server. However, this doesn't allow the user to call the default endpoint. So removing the update of the email after the call is made.

This is a safe change because in case when a email was specified by the user when making a cred object then mds server, return back same email, hence the current change doesn't effect this code path.

In case no email was specified, we call default service account endpoint, similar to other languages rather that updating the default with the email fetched from mds server. Both of these endpoints should return similar tokens in a normal case.

Tested the code on a GCE VM and verified the default path works as intended.

@harkamaljot harkamaljot requested review from a team March 4, 2025 00:44
Comment thread google/auth/compute_engine/credentials.py Outdated
Comment thread tests/compute_engine/test_credentials.py
@harkamaljot
Copy link
Copy Markdown
Contributor Author

closing this pull request in favor of #1769

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants