Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(js/plugins/google-cloud): pass projectId through to GoogleAuth client #1907

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MichaelDoyle
Copy link
Member

@MichaelDoyle MichaelDoyle commented Feb 10, 2025

WIP - testing in progress

I saw a bug in Discord where projectId being set in the options was not respected; in the end an alternative solution was found. After working on refactoring the docs, I realized we are not appropriately passing projectId along to the GoogleAuth client.

The specific use case is as follows: If the developer provides an external credential (either via credentials option, or via env variable) they must also provide the target projectId to the client.

In all other cases, projectId should be available and inferred from the client, as it will not work without the projectId set.

One possible point of confusion seems to arise with local user auth in development (i.e. gcloud auth application-default login). In this case, projectId might not be set. The solution is to provide it during auth (--project), set the gcloud cli default project, or set the environment variable GCLOUD_PROJECT.

Checklist (if applicable):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant