You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What do you think about renaming new() to from_application_default_credentials()? I was a little surprised when I found out that new depended on the GOOGLE_APPLICATION_CREDENTIALS env var being set. I also think it mirrors from_credentials nicely.
This would also set us up to implement the entire Application Default Credentials (ADC) flow in the future. This would require us querying metadata servers (on GCE or App Engine etc) to get credentials if the GOOGLE_APPLICATION_CREDENTIALS env var is not found.
The text was updated successfully, but these errors were encountered:
I don't really know what's best here.
According to this page from the official docs, the different official client libraries all do it in a slightly different way.
I picked Client::new() because of Golang's client, who does it like this:
// equivalent to our `Client::new()`storage.NewClient(ctx)
// equivalent to our `Client::from_credentials(creds)`storage.NewClient(ctx, option.WithCredentials(creds))
Maybe completing ADC can be done by extending/changing ApplicationCredentials ?
I don't know because I never used GCE nor App Engine.
let path = env::var("GOOGLE_APPLICATION_CREDENTIALS")?;
let file = File::open(path)?;
let creds = json::from_reader(file)?;
Currently these 3 lines are in all clients. How about extracting it to a function in the authorize module? Then if we want to support ADC in future, we only update one place.
What do you think about renaming
new()
tofrom_application_default_credentials()
? I was a little surprised when I found out thatnew
depended on theGOOGLE_APPLICATION_CREDENTIALS
env var being set. I also think it mirrorsfrom_credentials
nicely.This would also set us up to implement the entire Application Default Credentials (ADC) flow in the future. This would require us querying metadata servers (on GCE or App Engine etc) to get credentials if the
GOOGLE_APPLICATION_CREDENTIALS
env var is not found.The text was updated successfully, but these errors were encountered: