Git Product home page Git Product logo

Comments (4)

tomlarkworthy avatar tomlarkworthy commented on June 3, 2024 1

OK interesting. I am using Cloud Run which must be setup differently to GCE VMs (but it still has a local metadata sidecar). Yeah I found the flag override and everything is working with that.

Thanks for the emulator its great for testing.

from gce_metadata_server.

tomlarkworthy avatar tomlarkworthy commented on June 3, 2024

I see you have jus the email scope set. I am pretty sure the default behavior of metadata server includes https://www.googleapis.com/auth/cloud-platform

from gce_metadata_server.

salrashid123 avatar salrashid123 commented on June 3, 2024

The named default scopes (atleast generated by the cli) include a couple of others but not cloud-platform itself:
https://cloud.google.com/sdk/gcloud/reference/alpha/compute/instances/set-scopes

you get cloud-platform if you enable (on the ui) all apis.

I kept the minimal scopes here just to fulfill the /identity endpoint capabilities.

You could override the scopes w/ the flag which bootstraps the default credentials:

https://github.com/salrashid123/gce_metadata_server/blob/master/main.go#L404

from gce_metadata_server.

salrashid123 avatar salrashid123 commented on June 3, 2024

glad its helpful!. FWIW, the metadata servers between GCE and Run are slightly different. eg, in Cloud Run you can even specify non-Cloud API scopes:

curl "http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token?scopes=[SCOPES]"  -H "Metadata-Flavor: Google"

( i suppose i can add that into this metadata server implementation too)

from gce_metadata_server.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.