GithubHelp home page GithubHelp logo

go-routespreferred's Issues

Add ComputeRouteMatrix example.

Is your feature request related to a problem? Please describe.
Before ComputeRouteMatrix is generally available, there should be examples in the GAPIC libraries.

Describe the solution you'd like
Add a compute-route-matrix sample, much like compute-routes.

Describe alternatives you've considered
Use one sample to show both ComputeRoutes and ComputeRouteMatrix examples.

Use OAuth over API Keys in sample code

Is your feature request related to a problem? Please describe.
API Keys are explicitly not supported by the GAPIC libraries. While this can be worked around, the workaround is different for each language and generally pretty ugly. The GAPIC library samples should show OAuth usage instead of API Key usage.

Describe the solution you'd like
Change the sample code to use OAuth.

Describe alternatives you've considered
Continue to show API Key usage, or show both usages. - This will require work to figure out how to use API Keys in other GAPIC languages, and only serves to provide a more convenient but less secure authentication method.

Additional context
The Routes Preferred endpoint supports authentication via API Keys, OAuth, or Self-Signed JWTs. Both OAuth and Self-Signed JWTs are well-supported by GAPIC libraries.

Update Authentication section in README.

The section is currently outdated, as authentication is no longer limited to API keys.

Current state of authentication support:

  1. OAuth with service account credentials:
    1. Set by option.WithCredentialsFile(...).
    2. Set by environment variable GOOGLE_APPLICATION_CREDENTIALS.
    3. Set by AppEngine/Compute Engine environment. Note that your AppEngine/Compute Engine service account is likely not authorized to grant the routes preferred scope, so you'll have to update its scopes accordingly (https://cloud.google.com/compute/docs/access/create-enable-service-accounts-for-instances#changeserviceaccountandscopes). Also note that since we are not a cloud API, our scope will not appear on the cloud console and should be granted via gcloud CLI instead.
  2. Self-signed JWT:
    • Set by option.WithAudiences("https://routespreferred.googleapis.com/"), same credentials as OAuth.
    • Note: This doesn't seem to work with credentials provided by the AppEngine/Compute Engine environment.
  3. API Keys:
    • Unsupported in GAPIC libraries.

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.