ibm-cloud-sdk-core
Advanced tools
Comparing version 2.7.2 to 2.8.0
@@ -88,2 +88,9 @@ /** | ||
setScope(scope: string): void; | ||
/** | ||
* Return the most recently stored refresh token. | ||
* | ||
* @public | ||
* @returns {string} | ||
*/ | ||
getRefreshToken(): string; | ||
} |
@@ -101,4 +101,13 @@ "use strict"; | ||
}; | ||
/** | ||
* Return the most recently stored refresh token. | ||
* | ||
* @public | ||
* @returns {string} | ||
*/ | ||
IamAuthenticator.prototype.getRefreshToken = function () { | ||
return this.tokenManager.getRefreshToken(); | ||
}; | ||
return IamAuthenticator; | ||
}(token_request_based_authenticator_1.TokenRequestBasedAuthenticator)); | ||
exports.IamAuthenticator = IamAuthenticator; |
@@ -31,2 +31,3 @@ /** | ||
protected requiredOptions: string[]; | ||
protected refreshToken: string; | ||
private apikey; | ||
@@ -77,2 +78,18 @@ private clientId; | ||
/** | ||
* Return the most recently stored refresh token. | ||
* | ||
* @public | ||
* @returns {string} | ||
*/ | ||
getRefreshToken(): string; | ||
/** | ||
* Extend this method from the parent class to extract the refresh token from | ||
* the request and save it. | ||
* | ||
* @param tokenResponse - Response object from JWT service request | ||
* @protected | ||
* @returns {void} | ||
*/ | ||
protected saveTokenInfo(tokenResponse: any): void; | ||
/** | ||
* Request an IAM token using an API key. | ||
@@ -79,0 +96,0 @@ * |
@@ -127,2 +127,26 @@ "use strict"; | ||
/** | ||
* Return the most recently stored refresh token. | ||
* | ||
* @public | ||
* @returns {string} | ||
*/ | ||
IamTokenManager.prototype.getRefreshToken = function () { | ||
return this.refreshToken; | ||
}; | ||
/** | ||
* Extend this method from the parent class to extract the refresh token from | ||
* the request and save it. | ||
* | ||
* @param tokenResponse - Response object from JWT service request | ||
* @protected | ||
* @returns {void} | ||
*/ | ||
IamTokenManager.prototype.saveTokenInfo = function (tokenResponse) { | ||
_super.prototype.saveTokenInfo.call(this, tokenResponse); | ||
var responseBody = tokenResponse.result || {}; | ||
if (responseBody.refresh_token) { | ||
this.refreshToken = responseBody.refresh_token; | ||
} | ||
}; | ||
/** | ||
* Request an IAM token using an API key. | ||
@@ -129,0 +153,0 @@ * |
@@ -0,1 +1,8 @@ | ||
# [2.8.0](https://github.com/IBM/node-sdk-core/compare/v2.7.2...v2.8.0) (2021-02-19) | ||
### Features | ||
* **iam-authenticator:** expose refresh token with a getter - `getRefreshToken()` ([#122](https://github.com/IBM/node-sdk-core/issues/122)) ([d3c4611](https://github.com/IBM/node-sdk-core/commit/d3c46116e42ae6aff9e4a686e9ae4212635e46f2)) | ||
## [2.7.2](https://github.com/IBM/node-sdk-core/compare/v2.7.1...v2.7.2) (2021-02-10) | ||
@@ -2,0 +9,0 @@ |
{ | ||
"name": "ibm-cloud-sdk-core", | ||
"version": "2.7.2", | ||
"version": "2.8.0", | ||
"description": "Core functionality to support SDKs generated with IBM's OpenAPI SDK Generator.", | ||
@@ -5,0 +5,0 @@ "main": "index", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
224170
4237