-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
Description
From the google-cloud README, it's stated that google-cloud can be initialized with either a keyFilename field containing a path to a key file, or a credentials field containing that key file's contents. However, it seems like the behavior when key file is passed in through the keyFilename or the credentials field in the implementation of getAuthClient differs.
- For key files whose contents are supplied through the
credentialsfield, either aJWTClientorUserRefreshClientis constructed whencredentials.typeis "service_account" or "authorized_user" respectively. - For key files whose paths are referenced through the
keyFilenamefield, aJWTClientis created regardless of its contents.
In the latter case, any key file with the type field as "authorized_user" will cause an error (because it doesn't have a client_email field).
Would it be appropriate to have getAuthClient read the key file when keyFilename exists, and process its contents just as it would if the key file already populated the credentials field?