peburrows / goth

Elixir package for Oauth authentication via Google Cloud APIs
http://hexdocs.pm/goth
MIT License
285 stars 108 forks source link

new env variable from spec #16

Closed alexfilatov closed 6 years ago

alexfilatov commented 7 years ago

Added possibility to read JSON credentials from the ENV variable which points to JSON credentials file stored locally. This added flexibility for setting up different key files for different servers

peburrows commented 7 years ago

Hrm, we should definitely handle the case where the credentials path is in the GOOGLE_APPLICATION_CREDENTIALS ENV variable, but it seems a bit strange to treat {:system, var} differently depending on the name of the variable.

Let me investigate this a bit. This might very well be the best way to do it, but I want to think about whether or not there is a more elegant way to handle this situation.

peburrows commented 7 years ago

The solution might be to provide a :json_path config, as suggested in https://github.com/peburrows/goth/pull/15

alexfilatov commented 7 years ago

Yes, this is ok solution with :json_file, thanks for pointing me out. What I mean in my Pull Request is a bit different: https://12factor.net/config - store all configuration in the environment, and per GC spec they suggest the same thing. You are right - adding additional ENV_VAR looks not elegant at all, but I left it for backward compatibility. DevOps guys will thank you for 12-factor solution :)

dazuma commented 7 years ago

Agreed that :json_path or similar would be good, to distinguish from the :json content.

And agreed that proper support for GOOGLE_APPLICATION_CREDENTIALS, and in general the entire application default credentials protocol, will be very important.

dazuma commented 6 years ago

This was superseded by https://github.com/peburrows/goth/pull/22. Suggest we close it.

peburrows commented 6 years ago

Agreed, closing.