-
Notifications
You must be signed in to change notification settings - Fork 370
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
How to do auth for public buckets #828
Comments
Greetings! That host name is correct :) The trailing The issue here is likely authentication. How are you expecting your electron users to authenticate to the backend API? Are you trying to embed a service account key with your app? |
Hey @JustinBeckwith, thanks for getting on this.
But I am getting the same error as above.
For private buckets, I am asking users to upload their service account JSON, and private buckets are working fine using the node SDK. |
Also, FYI. The SDK implementation for public buckets works fine in development mode for the electron app. It only breaks in production. |
Without providing any sort of credentials, our libraries assume your app is running in a Google Cloud Platform environment. So, it tries to ping that internal metadata server. However, it hasn't been doing that for me when I try to recreate the issue. I think I will need a more complete demonstration to reproduce. Could you make the smallest possible scenario-- something I can clone and run? What I've Also feel free to just make edits directly to the gist to make it closer to how yours works. |
it works for me as well, in dev env. But in prod builds, it doesn't. |
I deployed to the now servers when testing, which worked as well. I'm excited to find out what's going on! |
@ritikrishu is your prod environment running under a proxy? This caused problems in another issue here |
@ritikrishu is this still an issue? I'm going to close since I couldn't reproduce, but I'm happy to re-open if we can get more information. Thanks! |
Environment details
gcp-metadata
version: 1.0.0Steps to reproduce
We are using google cloud storage SDK to fetch object keys from any public bucket in an electron-based app. The code snippet that we have is-
Private buckets work fine where we also pass the services.json. Public buckets work with same code as above in dev mode but in prod builds we get the following error-
Also, I wonder if the host name here is correct, https://github.com/googleapis/gcp-metadata/blob/aa708dd9788cf12e084be1a9bdfe8594288710ae/src/index.ts#L12.
http://metadata.google.internal
does not look right.Thanks!
The text was updated successfully, but these errors were encountered: