brendanhay / gogol

A comprehensive Google Services SDK for Haskell.
Other
280 stars 105 forks source link

Api key based auth #19

Open robinp opened 8 years ago

robinp commented 8 years ago

Would it be possible to add apikey auth? For example, Translate API doesn't need token exchange, but works by just including a secret key in the url (https://cloud.google.com/translate/v2/getting_started?csw=1).

Note: I tried from devel branch head with a service account, and got Forbidden, so I assume Translate API only accepts the api key or OAuth (but the latter is not needed, since there is no user data here).

Slightly related: is it possible to pass quotaUser and/or userIp parameter for that API? See https://support.google.com/cloud/answer/6158858?hl=en&ref_topic=6262490 .

brendanhay commented 8 years ago

The internal facilities are there to pass the key on the URL, but I'd have liked a way to ensure that you use the correct authentication mechanism for the relevant service. Since that's currently unsolved, I'll look at simply exposing the ability to add it directly to the querystring.

For the latter two, it's a similar story - I'll create a separate issue for those.