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

Feature request: make environment variables compatible with google-cloud-ruby #1852

Closed
timanovsky opened this issue Dec 2, 2016 · 3 comments
Assignees
Labels
api: datastore Issues related to the Datastore API.

Comments

@timanovsky
Copy link

It would be nice if node and ruby applications can use the same configuration environment variables, and same preceding logic. In my particular project I'm using two variables: DATASTORE_EMULATOR_HOST and GCLOUD_KEYFILE_JSON. First have higher priority. If it is unset, datastore client goes to service endpoint specified by content of GCLOUD_KEYFILE_JSON. For node application I need to implement it myself

See how it is used here for example: https://github.com/GoogleCloudPlatform/google-cloud-ruby/blob/ea2be47beb32615b2bf69f8a846a684f86c8328c/google-cloud-datastore/lib/google/cloud/datastore/credentials.rb

@stephenplusplus
Copy link
Contributor

stephenplusplus commented Dec 2, 2016

We do support the datastore emulator variable, and for JSON, try GOOGLE_APPLICATION_CREDENTIALS, which comes from when you authenticate using the gcloud SDK, but you can set the env var manually to point to a JSON key file. That should be supported in Ruby as well.

@stephenplusplus stephenplusplus added auth api: datastore Issues related to the Datastore API. labels Dec 2, 2016
@stephenplusplus
Copy link
Contributor

Going to close @timanovsky, but let me know if GOOGLE_APPLICATION_CREDENTIALS doesn't do the trick.

@lukewlms
Copy link

lukewlms commented Jun 27, 2018

There's a solution here for using environment variables instead of an on-disk file (critical for our Heroku setup).

You can authenticate with credentials: { private_key, client_email } rather than path to a json file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API.
Projects
None yet
Development

No branches or pull requests

3 participants