bitski-node
Advanced tools
Comparing version 0.3.0 to 0.4.0
@@ -12,3 +12,4 @@ import { AccessToken, AccessTokenProvider } from 'bitski-provider'; | ||
getAccessToken(): Promise<string>; | ||
invalidateToken(): Promise<void>; | ||
private requestNewAccessToken; | ||
} |
@@ -29,2 +29,6 @@ "use strict"; | ||
} | ||
invalidateToken() { | ||
this.accessToken = undefined; | ||
return Promise.resolve(); | ||
} | ||
requestNewAccessToken() { | ||
@@ -31,0 +35,0 @@ return this.oauthClient.clientCredentials.getToken(this.options).then((result) => { |
{ | ||
"name": "bitski-node", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "Bitski SDK for Node environments", | ||
@@ -22,3 +22,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"bitski-provider": "^0.3.0", | ||
"bitski-provider": "^0.4.0", | ||
"simple-oauth2": "^2.2.0" | ||
@@ -25,0 +25,0 @@ }, |
@@ -66,1 +66,4 @@ # Bitski Node Provider | ||
``` | ||
## Report Vulnerabilities | ||
Bitski provides a “bug bounty” to engage with the security researchers in the community. If you have found a vulnerability in our product or service, please [submit a vulnerability report](https://www.bitski.com/bounty) to the Bitski security team. |
@@ -35,2 +35,7 @@ import { AccessToken, AccessTokenProvider } from 'bitski-provider'; | ||
public invalidateToken(): Promise<void> { | ||
this.accessToken = undefined; | ||
return Promise.resolve(); | ||
} | ||
private requestNewAccessToken(): Promise<AccessToken> { | ||
@@ -37,0 +42,0 @@ return this.oauthClient.clientCredentials.getToken(this.options).then((result) => { |
@@ -26,1 +26,12 @@ import CredentialTokenProvider from '../src/auth/credential-token-provider'; | ||
}); | ||
test('it clears access tokens when requested', () => { | ||
expect.assertions(1); | ||
const provider = new CredentialTokenProvider({ id: 'test-id', secret: 'test-secret' }, {}); | ||
// @ts-ignore | ||
provider.accessToken = new AccessToken('test-access-token', 3600); | ||
return provider.invalidateToken().then(() => { | ||
// @ts-ignore | ||
expect(provider.accessToken).toBeUndefined(); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
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
20570
343
69
+ Addedbitski-provider@0.4.2(transitive)
- Removedbitski-provider@0.3.0(transitive)
Updatedbitski-provider@^0.4.0