bitski-node
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -18,4 +18,9 @@ "use strict"; | ||
const oauthSettings = Object.assign({ client: credentials }, DEFAULT_AUTH_OPTIONS); | ||
this.oauthClient = simple_oauth2_1.create(oauthSettings); | ||
this.options = Object.assign({}, DEFAULT_TOKEN_OPTIONS, options); | ||
try { | ||
this.oauthClient = simple_oauth2_1.create(oauthSettings); | ||
this.options = Object.assign({}, DEFAULT_TOKEN_OPTIONS, options); | ||
} | ||
catch (e) { | ||
throw new Error('Invalid credentials provided. Please check your credentials format and try again.'); | ||
} | ||
} | ||
@@ -22,0 +27,0 @@ getAccessToken() { |
{ | ||
"name": "bitski-node", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "Bitski SDK for Node environments", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -22,4 +22,8 @@ import { AccessToken, AccessTokenProvider } from 'bitski-provider'; | ||
const oauthSettings = Object.assign({ client: credentials }, DEFAULT_AUTH_OPTIONS); | ||
this.oauthClient = OAuth2(oauthSettings); | ||
this.options = Object.assign({}, DEFAULT_TOKEN_OPTIONS, options); | ||
try { | ||
this.oauthClient = OAuth2(oauthSettings); | ||
this.options = Object.assign({}, DEFAULT_TOKEN_OPTIONS, options); | ||
} catch (e) { | ||
throw new Error('Invalid credentials provided. Please check your credentials format and try again.'); | ||
} | ||
} | ||
@@ -26,0 +30,0 @@ |
@@ -17,1 +17,11 @@ import { getProvider } from '../src/index'; | ||
}); | ||
test('it does not show secrets in the console', () => { | ||
try { | ||
// Intentionally passing invalid extra data to trigger error | ||
getProvider('test', { credentials: { secret: 'super-secret-value', network: 'mainnet' }}); | ||
} catch (e) { | ||
// Error message should be generic to protect sensitive data from being logged. | ||
expect(e.message).not.toMatch(/super-secret-value/); | ||
} | ||
}); |
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
21365
361