google / webrisk

Apache License 2.0
67 stars 34 forks source link

Replace common *http.Client with Google API transport #55

Closed ErikBooijMB closed 1 year ago

ErikBooijMB commented 1 year ago

Currently the Webrisk client requires authentication with an API key, which can be inconvenient or even impossible in certain circumstances/environments. In our case we need to authenticate through our application default credentials, and this change aims to make that possible.

By substituting the raw *http.Client for the client provided by Google's own API Client package, this becomes possible with no change required for consumers of the client.

For users authenticating with an API key, that continues to function as-is, for users starting to use this client, they can choose between API key or ADC.

ErikBooijMB commented 1 year ago

Sorry, wrong upstream 🤦🏻‍♂️