-
Notifications
You must be signed in to change notification settings - Fork 108
Provide user's project ID to google-auto-auth. #28
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
Conversation
| scopes: v1.DatastoreClient.scopes, | ||
| servicePath: datastore.baseUrl_, | ||
| port: 443, | ||
| projectId: undefined, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Codecov Report
@@ Coverage Diff @@
## master #28 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 5 5
Lines 643 645 +2
=====================================
+ Hits 643 645 +2
Continue to review full report at Codecov.
|
| this.namespace = options.namespace; | ||
|
|
||
| const userProvidedProjectId = | ||
| options.projectId || process.env.DATASTORE_PROJECT_ID; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
test/index.js
Outdated
| ); | ||
| }); | ||
|
|
||
| it('should cache the correct projectId', function() {}); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Fixes #27
When we switched to GAPIC, we put a funnel method in front of all API requests before they were sent to GAPIC. From that, we get the
projectIdfrom google-auto-auth, to fill in any placeholders. We overlooked a scenario where a projectId is provided by the user already, such as when they are using a local emulator.After this PR, we will honor that project ID, and not ask google-auto-auth to try to grab it from a credentials file (which is not generally provided when users are working from a local emulator).