-
Notifications
You must be signed in to change notification settings - Fork 15
Description
What do you think about supporting Application Default Credentials? To start we could just check GOOGLE_APPLICATION_CREDENTIALS.
Down the road, we could also communicate with the metadata server to automatically obtain credentials if GOOGLE_APPLICATION_CREDENTIALS wasn’t provided. This would obviously be more involved but I think reverse engineering this process from one of the official client libraries wouldn’t be too bad.
So the flow would be:
- Try to use an explicitly provided service account.
- If
None, checkGOOGLE_APPLICATION_CREDENTIALS - (Future work) If
None, communicate with metadata server to use default service account - If still not found,
Err.
This might belong in yup-oauth2 because right now google_api_auth pretty much wraps it, but this might be a little too Google-specific for yup-oauth2?
Maybe we could support this auth flow (which would use yup-oauth2 under the hood) as a sibling to the one provided by the with-yup-oauth2 feature? Honestly, I think this abstracted away flow should be the default and users could opt in to with-yup-oauth2 if they want more control. Although, it would be a little weird that this default feature would depend on yup-oauth2, in addition to the explicit non-default feature depending on it as well...
One of the things I love about GCP (as opposed to AWS etc) is their authentication mechanism. It is so seamless and uniform across all their APIs. This would be a big step towards that UX.
Once we decide on a direction, I would be happy to open a PR.