Skip to content

Commit

Permalink
error-reporting: Fix an issue where authorization would fail (#2336)
Browse files Browse the repository at this point in the history
The `keyFilename` and `credentials` values specified in the
configuration to the error-reporting library were not being
used to communicate through the API.  This would cause
communication through the error-reporting API to fail.
  • Loading branch information
DominicKramer authored and stephenplusplus committed May 31, 2017
1 parent 563ec3b commit 0421ba8
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions packages/error-reporting/src/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ var Configuration = function(givenConfig, logger) {
*/
this._key = null;
/**
* The _keyFilename property is meant to contain a path to a file containing
* The keyFilename property is meant to contain a path to a file containing
* user or service account credentials, which will be used in place of
* application default credentials. This property will remain null if no
* value for keyFilename is given in the runtime configuration.
Expand All @@ -113,9 +113,9 @@ var Configuration = function(givenConfig, logger) {
* @type {String|Null}
* @defaultvalue null
*/
this._keyFilename = null;
this.keyFilename = null;
/**
* The _credentials property is meant to contain an object representation of
* The credentials property is meant to contain an object representation of
* user or service account credentials, which will be used in place of
* application default credentials. This property will remain null if no
* value for credentials is given in the runtime configuration.
Expand All @@ -124,7 +124,7 @@ var Configuration = function(givenConfig, logger) {
* @type {Credentials|Null}
* @defaultvalue null
*/
this._credentials = null;
this.credentials = null;
/**
* The _serviceContext property is meant to contain the optional service
* context information which may be given in the runtime configuration. If
Expand Down Expand Up @@ -258,12 +258,12 @@ Configuration.prototype._gatherLocalConfiguration = function() {
throw new Error('config.key must be a string');
}
if (isString(this._givenConfiguration.keyFilename)) {
this._keyFilename = this._givenConfiguration.keyFilename;
this.keyFilename = this._givenConfiguration.keyFilename;
} else if (has(this._givenConfiguration, 'keyFilename')) {
throw new Error('config.keyFilename must be a string');
}
if (isObject(this._givenConfiguration.credentials)) {
this._credentials = this._givenConfiguration.credentials;
this.credentials = this._givenConfiguration.credentials;
} else if (has(this._givenConfiguration, 'credentials')) {
throw new Error('config.credentials must be a valid credentials object');
}
Expand Down Expand Up @@ -335,24 +335,24 @@ Configuration.prototype.getKey = function() {
return this._key;
};
/**
* Returns the _keyFilename property on the instance.
* Returns the keyFilename property on the instance.
* @memberof Configuration
* @public
* @function getKeyFilename
* @returns {String|Null} - returns the _keyFilename property
* @returns {String|Null} - returns the keyFilename property
*/
Configuration.prototype.getKeyFilename = function() {
return this._keyFilename;
return this.keyFilename;
};
/**
* Returns the _credentials property on the instance.
* Returns the credentials property on the instance.
* @memberof Configuration
* @public
* @function getCredentials
* @returns {Credentials|Null} - returns the _credentials property
* @returns {Credentials|Null} - returns the credentials property
*/
Configuration.prototype.getCredentials = function() {
return this._credentials;
return this.credentials;
};
/**
* Returns the _serviceContext property on the instance.
Expand Down

0 comments on commit 0421ba8

Please sign in to comment.