@duosecurity/duo_api
Advanced tools
Comparing version 1.2.3 to 1.3.0
@@ -78,3 +78,3 @@ var crypto = require('crypto') | ||
var canon = canonicalize(method, host, path, params, date) | ||
var sig = crypto.createHmac('sha1', skey) | ||
var sig = crypto.createHmac('sha512', skey) | ||
.update(canon) | ||
@@ -81,0 +81,0 @@ .digest('hex') |
var duo_sig = require('./duo_sig') | ||
var https = require('https') | ||
var querystring = require('querystring') | ||
var constants = require('./constants') | ||
// Constants for handling rate limit backoff and retries | ||
const _MAX_BACKOFF_WAIT_SECS = 32 | ||
const _BACKOFF_FACTOR = 2 | ||
const _RATE_LIMITED_RESP_CODE = 429 | ||
const _PACKAGE_VERSION = require('../package.json').version | ||
@@ -41,3 +37,4 @@ | ||
'path': path, | ||
'headers': headers | ||
'headers': headers, | ||
'ca': constants.DUO_PINNED_CERT | ||
} | ||
@@ -49,7 +46,7 @@ _request_with_backoff(options, body, callback) | ||
var req = https.request(options, function (res) { | ||
if (res.statusCode === _RATE_LIMITED_RESP_CODE && | ||
waitSecs <= _MAX_BACKOFF_WAIT_SECS) { | ||
if (res.statusCode === constants._RATE_LIMITED_RESP_CODE && | ||
waitSecs <= constants._MAX_BACKOFF_WAIT_SECS) { | ||
var randomOffset = Math.floor(Math.random() * 1000) | ||
setTimeout(function () { | ||
_request_with_backoff(options, body, callback, waitSecs * _BACKOFF_FACTOR) | ||
_request_with_backoff(options, body, callback, waitSecs * constants._BACKOFF_FACTOR) | ||
}, waitSecs * 1000 + randomOffset) | ||
@@ -56,0 +53,0 @@ return |
{ | ||
"name": "@duosecurity/duo_api", | ||
"version": "1.2.3", | ||
"version": "1.3.0", | ||
"license": "BSD-3-Clause", | ||
@@ -5,0 +5,0 @@ "description": "Duo API SDK for Node.js applications", |
@@ -15,2 +15,13 @@ # Overview | ||
## Node Versions Tested Against: | ||
* 8 | ||
* 10 | ||
* 12 | ||
* 14 | ||
* 15 | ||
## TLS 1.2 and 1.3 Support | ||
Duo_api_nodejs uses the Node tls library and OpenSSL for TLS operations. All versions of Node receiving security support (14 and higher) use OpenSSL 1.1.1 which supports TLS 1.2 and 1.3. | ||
# Installing | ||
@@ -17,0 +28,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
34271
14
630
82