Skip to content

Commit 9a9d0cf

Browse files
fix: accept lowercase env vars (#578)
1 parent 05e7adc commit 9a9d0cf

File tree

2 files changed

+1296
-1240
lines changed

2 files changed

+1296
-1240
lines changed

src/auth/googleauth.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,8 @@ export class GoogleAuth {
288288
*/
289289
async _tryGetApplicationCredentialsFromEnvironmentVariable(
290290
options?: RefreshOptions): Promise<JWT|UserRefreshClient|null> {
291-
const credentialsPath = process.env['GOOGLE_APPLICATION_CREDENTIALS'];
291+
const credentialsPath = process.env['GOOGLE_APPLICATION_CREDENTIALS'] ||
292+
process.env['google_application_credentials'];
292293
if (!credentialsPath || credentialsPath.length === 0) {
293294
return null;
294295
}
@@ -583,7 +584,9 @@ export class GoogleAuth {
583584
* @api private
584585
*/
585586
private getProductionProjectId() {
586-
return process.env['GCLOUD_PROJECT'] || process.env['GOOGLE_CLOUD_PROJECT'];
587+
return process.env['GCLOUD_PROJECT'] ||
588+
process.env['GOOGLE_CLOUD_PROJECT'] || process.env['gcloud_project'] ||
589+
process.env['google_cloud_project'];
587590
}
588591

589592
/**

0 commit comments

Comments
 (0)