google-auth-library
Advanced tools
Comparing version
@@ -334,5 +334,19 @@ "use strict"; | ||
try { | ||
const data = JSON.parse(s); | ||
const r = this._cacheClientFromJSON(data, options); | ||
return resolve(r); | ||
try { | ||
const data = JSON.parse(s); | ||
const r = this._cacheClientFromJSON(data, options); | ||
return resolve(r); | ||
} | ||
catch (err) { | ||
// If we failed parsing this.keyFileName, assume that it | ||
// is a PEM or p12 certificate: | ||
if (!this.keyFilename) | ||
throw err; | ||
const client = new jwtclient_1.JWT({ | ||
...this.clientOptions, | ||
keyFile: this.keyFilename, | ||
}); | ||
this.cachedCredential = client; | ||
return resolve(client); | ||
} | ||
} | ||
@@ -339,0 +353,0 @@ catch (err) { |
@@ -7,2 +7,9 @@ # Changelog | ||
### [6.1.5](https://www.github.com/googleapis/google-auth-library-nodejs/compare/v6.1.4...v6.1.5) (2021-01-22) | ||
### Bug Fixes | ||
* support PEM and p12 when using factory ([#1120](https://www.github.com/googleapis/google-auth-library-nodejs/issues/1120)) ([c2ead4c](https://www.github.com/googleapis/google-auth-library-nodejs/commit/c2ead4cc7650f100b883c9296fce628f17085992)) | ||
### [6.1.4](https://www.github.com/googleapis/google-auth-library-nodejs/compare/v6.1.3...v6.1.4) (2020-12-22) | ||
@@ -9,0 +16,0 @@ |
{ | ||
"name": "google-auth-library", | ||
"version": "6.1.4", | ||
"version": "6.1.5", | ||
"author": "Google Inc.", | ||
@@ -49,3 +49,3 @@ "description": "Google APIs Authentication Client Library for Node.js", | ||
"is-docker": "^2.0.0", | ||
"karma": "^5.0.0", | ||
"karma": "^6.0.0", | ||
"karma-chrome-launcher": "^3.0.0", | ||
@@ -52,0 +52,0 @@ "karma-coverage": "^2.0.0", |
243080
0.42%4009
0.35%