Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fast-azure-storage

Package Overview
Dependencies
Maintainers
9
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-azure-storage - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

44

lib/authorization.js

@@ -17,24 +17,22 @@ var querystring = require('querystring');

this._nextSASRefresh = 0;
// Refresh SAS
this._sas = Promise.resolve(this.options.sas());
// Update _nextSASRefresh when the SAS has been refreshed
this._sas.then(function(sas) {
sas = querystring.parse(sas);
// Find next sas refresh time
self._nextSASRefresh = (
new Date(sas.se).getTime() - self.options.minSASAuthExpiry
);
debug("Refreshed shared-access-signature, will refresh in %s ms",
self._nextSASRefresh);
// Throw an error if the signature expiration comes too soon
if (Date.now() > self._nextSASRefresh) {
throw new Error("Refreshed SAS, but got a Shared-Access-Signature " +
"that expires less than options.minSASAuthExpiry " +
"from now, signature expiry: " + sas.se);
}
}).catch(function(err) {
// If we have an error freshing SAS that's bad and we'll emit it; for most
// apps it's probably best to ignore this error and just crash.
self.emit('error', err);
});
// Refresh SAS and update _nextSASRefresh when the SAS has been refreshed
this._sas = Promise.resolve(this.options.sas())
.then(function(sasString) {
sas = querystring.parse(sasString);
// Find next sas refresh time
self._nextSASRefresh = (
new Date(sas.se).getTime() - self.options.minSASAuthExpiry
);
debug("Refreshed shared-access-signature, will refresh at",
new Date(self._nextSASRefresh));
// Throw an error if the signature expiration comes too soon
if (Date.now() > self._nextSASRefresh) {
throw new Error("Refreshed SAS, but got a Shared-Access-Signature " +
"that expires less than options.minSASAuthExpiry (" +
self.options.minSASAuthExpiry / 1000 +
"s) from now; signature expiry: " + sas.se);
}
return sasString;
});
}

@@ -184,2 +182,2 @@

exports.authorizeWithSharedKey = authorizeWithSharedKey;
exports.authorizeWithSharedKey = authorizeWithSharedKey;

@@ -329,4 +329,4 @@ 'use strict';

debug("Error code: %s for %s %s on retry: %s",
err.code, method, path, retry);
debug("Error code: %s (%s) for %s %s on retry: %s",
data.code, res.statusCode, method, path, retry);

@@ -333,0 +333,0 @@ // Throw the constructed error

@@ -412,4 +412,4 @@ 'use strict';

debug("Error code: %s for %s %s on retry: %s",
code, method, path, retry);
debug("Error code: %s (%s) for %s %s on retry: %s",
code, res.statusCode, method, path, retry);

@@ -416,0 +416,0 @@ // Throw the constructed error

{
"name": "fast-azure-storage",
"version": "2.0.0",
"version": "2.1.0",
"author": "Jonas Finnemann Jensen <jopsen@gmail.com>, Elena Solomon <elenasolomon28@gmail.com>",

@@ -17,2 +17,5 @@ "description": "Fast client library for azure storage services",

},
"files": [
"lib"
],
"engines": {

@@ -19,0 +22,0 @@ "node": ">=4"

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc