Git Product home page Git Product logo

Comments (5)

domesticmouse avatar domesticmouse commented on May 16, 2024 1

Cool, thanks for the clarification. I'm glad the current design is workable for you.

from google-maps-services-go.

domesticmouse avatar domesticmouse commented on May 16, 2024

I'd kinda prefer not to expose the signing logic. Is it possible to feed your requests through the static map API?

from google-maps-services-go.

superstas avatar superstas commented on May 16, 2024

I understand, but for some reasons, it doesn't fit for us.
It would work if StaticMapRequest had method SignURL(clientID string, secret []byte)

for instance:

// create request
r := StaticMapRequest{}
s := r.SignURL(clientID, secret) // staticMapAPI.path is used inside

Unfortunately, AFAIU in that case, it should be added to each request for consistency, and this is not a good way.

Anyway, thanks for helping!

from google-maps-services-go.

domesticmouse avatar domesticmouse commented on May 16, 2024

Can you explain how the addition of this method to the StaticMapRequest would help?

from google-maps-services-go.

superstas avatar superstas commented on May 16, 2024

Sure. I have a mobile client that has already had an implemented logic showing pictures generated via StaticMap API. It used to work with API_KEY until the rules have changed.

Now it sends to the backend a StaticMap API query for signing. As for instance, a query client=clientID&origin=Toronto gets a signed URL https://maps.googleapis.com/maps/api/staticmap?client=clientID&origin=Toronto&signature=mPvi3crsSSM1olW2lXmzUWcLB_8= as a response.

I agree that my previous proposal is not correct. Having a method Sign is useless, cause it adds extra step of converting client=clientID&origin=Toronto -> StaticMapRequest.

In case, of making Sign func public, private apiConfig should be exported as well.

So, I think the current implementation is good enough.

from google-maps-services-go.

Related Issues (20)

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.