New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

azure-storage

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

azure-storage - npm Package Compare versions

Comparing version

to
2.9.0-preview

lib/common/models/tokencredential.js

5

browser/azure-storage.blob.export.js

@@ -39,2 +39,6 @@ //

module.exports.createBlobServiceWithTokenCredential = function (host, tokenCredential) {
return new BlobService(null, null, host, null, null, tokenCredential);
};
module.exports.createBlobServiceAnonymous = function (host) {

@@ -66,2 +70,3 @@ return new BlobService(null, null, host, null);

module.exports.date = azureCommon.date;
module.exports.TokenCredential = azureCommon.TokenCredential;

@@ -68,0 +73,0 @@ // Other filters

@@ -40,2 +40,6 @@ //

module.exports.createQueueServiceWithTokenCredential = function (host, tokenCredential) {
return new QueueService(null, null, host, null, null, tokenCredential);
};
var azureCommon = require('../lib/common/common.browser');

@@ -63,2 +67,3 @@ var StorageServiceClient = azureCommon.StorageServiceClient;

module.exports.date = azureCommon.date;
module.exports.TokenCredential = azureCommon.TokenCredential;

@@ -65,0 +70,0 @@ // Other filters

3

browser/bundle.js

@@ -25,3 +25,4 @@ //

'// Azure Storage JavaScript Client Library ' + version,
'// Copyright (c) Microsoft and contributors. All rights reserved.'
'// Copyright (c) Microsoft and contributors. All rights reserved.',
'/* eslint-disable */'
].join('\n') + '\n';

@@ -28,0 +29,0 @@

Note: This is the change log file for Azure Storage JavaScript Client Library.
2018.05 Version 2.9.100-preview
ALL
* Generated browser compatible JavaScript files based on Microsoft Azure Storage SDK for Node.js 2.9.0-preview.
* Updated storage service version to 2017-11-09.
* Added `/* eslint-disable */` to generated JS files to avoid eslint warnings when using with create-react-app.
* Added `progress` event for `SpeedSummary` class, which will be triggered when every progress updates.
BLOB
* Added `createBlobServiceWithTokenCredential()` to create `BlobService` object with bearer tokens such as OAuth access token (in preview).
* Added support for '$web' as a valid blob container name for static website.
* Added support for write-once read-many containers.
* The `Get Container Properties` and `List Containers` APIs now return two new properties indicating whether the container has an immutability policy or a legal hold.
* The `Get Blob Properties` and `List Blobs` APIs now return the creation time of the blob as a property.
QUEUE
* Added `createQueueServiceWithTokenCredential()` to create `QueueService` object with bearer tokens such as OAuth access token (in preview).
2018.04 Version 2.8.100+2.8.2

@@ -4,0 +22,0 @@

Note: This is an Azure Storage only package. The all up Azure node sdk still has the old storage bits in there. In a future release, those storage bits will be removed and an npm dependency to this storage node sdk will
be taken. This is a GA release and the changes described below indicate the changes from the Azure node SDK 0.9.8 available here - https://github.com/Azure/azure-sdk-for-node.
2018.05 Version 2.9.0-preview
ALL
* Updated storage service version to 2017-11-09.
* Added `progress` event for `SpeedSummary` class, which will be triggered when every progress updates.
* Bumped version of request module from ~2.83.0 to ^2.86.0 to solve a vulnerability issue.
BLOB
* Added `createBlobServiceWithTokenCredential()` to create `BlobService` object with bearer tokens such as OAuth access token (in preview).
* Added support for '$web' as a valid blob container name for static website.
* Added support for write-once read-many containers.
* The `Get Container Properties` and `List Containers` APIs now return two new properties indicating whether the container has an immutability policy or a legal hold.
* The `Get Blob Properties` and `List Blobs` APIs now return the creation time of the blob as a property.
QUEUE
* Added `createQueueServiceWithTokenCredential()` to create `QueueService` object with bearer tokens such as OAuth access token (in preview).
2018.05 Version 2.8.3

@@ -17,2 +34,3 @@

* Fixed a TypeScript definition error that `blobService.getUrl()` misses `snapshotId` parameter.
* Fixed a bug that `Speedsummary` doesn't get updated when downloading file/blob under 32MB.

@@ -19,0 +37,0 @@ FILE

@@ -114,2 +114,20 @@ //

/**
* Creates a new {@link BlobService} object using the host Uri and the {@link TokenCredential} provided, which supports OAuth.
*
* @param {string|object} host The host address. To define primary only, pass a string.
* Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host.
* @param {TokenCredential} tokenCredential The token credential object.
* @return {BlobService} A new BlobService object with the {@link TokenCredential} object.
*
* @example
* var azure = require('azure-storage');
* var tokenCredential = new azure.TokenCredential('myOAuthAccessToken');
* var blobService = azure.createBlobServiceWithTokenCredential('https://account.blob.core.windows.net', tokenCredential);
* tokenCredential.set('updatedOAuthAccessToken');
*/
exports.createBlobServiceWithTokenCredential = function (host, tokenCredential) {
return new BlobService(null, null, host, null, null, tokenCredential);
};
/**
* Creates a new {@link BlobService} object using the host uri and anonymous access.

@@ -199,2 +217,20 @@ *

/**
* Creates a new {@link QueueService} object using the host Uri and the {@link TokenCredential} provided, which supports OAuth.
*
* @param {string|object} host The host address. To define primary only, pass a string.
* Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host.
* @param {TokenCredential} tokenCredential The TokenCredential object.
* @return {QueueService} A new QueueService object with the {@link TokenCredential} object.
*
* @example
* var azure = require('azure-storage');
* var tokenCredential = new azure.TokenCredential('myOAuthAccessToken');
* var queueService = azure.createQueueServiceWithTokenCredential('https://account.queue.core.windows.net', tokenCredential);
* tokenCredential.set('updatedOAuthAccessToken');
*/
exports.createQueueServiceWithTokenCredential = function (host, tokenCredential) {
return new QueueService(null, null, host, null, null, tokenCredential);
};
/**
* Account SAS

@@ -367,2 +403,3 @@ * @ignore

exports.date = azureCommon.date;
exports.TokenCredential = azureCommon.TokenCredential;

@@ -369,0 +406,0 @@ // Other filters

@@ -41,2 +41,3 @@ //

exports.AclResult = require('./models/aclresult');
exports.TokenCredential = require('./models/tokencredential');

@@ -43,0 +44,0 @@ // Filters

@@ -46,2 +46,3 @@ //

var SharedAccessSignature = require('../signing/sharedaccesssignature');
var TokenSigner = require('../signing/tokensigner');

@@ -72,5 +73,6 @@ var HeaderConstants = Constants.HeaderConstants;

* @param {bool} usePathStyleUri Boolean value indicating wether to use path style uris.
* @param {string} sasToken The Shared Access Signature token.
* @param {string} sas The Shared Access Signature string.
* @param {TokenCredential} [token] The {@link TokenCredential} object, which can be created with an OAuth access token string.
*/
function StorageServiceClient(storageAccount, storageAccessKey, host, usePathStyleUri, sasToken) {
function StorageServiceClient(storageAccount, storageAccessKey, host, usePathStyleUri, sas, token) {
StorageServiceClient['super_'].call(this);

@@ -83,6 +85,10 @@

this.storageCredentials = new SharedKey(this.storageAccount, this.storageAccessKey, usePathStyleUri);
} else if (sasToken) {
} else if (sas) {
// sas
this.sasToken = sasToken;
this.storageCredentials = new SharedAccessSignature(sasToken);
this.sasToken = sas;
this.storageCredentials = new SharedAccessSignature(sas);
} else if (token) {
// access token
this.token = token;
this.storageCredentials = new TokenSigner(token);
} else {

@@ -900,14 +906,15 @@ // anonymous

* @param {string} [host] The host address.
* @param {object} [sasToken] The sas token.
* @param {object} [sas] The Shared Access Signature string.
* @param {TokenCredential} [token] The {@link TokenCredential} object.
*
* @return {StorageServiceSettings}
*/
StorageServiceClient.getStorageSettings = function (storageAccountOrConnectionString, storageAccessKey, host, sasToken, endpointSuffix) {
StorageServiceClient.getStorageSettings = function (storageAccountOrConnectionString, storageAccessKey, host, sas, endpointSuffix, token) {
var storageServiceSettings;
if (storageAccountOrConnectionString && !storageAccessKey && !sasToken) {
if (storageAccountOrConnectionString && !storageAccessKey && !sas) {
// If storageAccountOrConnectionString was passed and no accessKey was passed, assume connection string
storageServiceSettings = StorageServiceSettings.createFromConnectionString(storageAccountOrConnectionString);
} else if ((storageAccountOrConnectionString && storageAccessKey) || sasToken || host) {
} else if ((storageAccountOrConnectionString && storageAccessKey) || sas || token || host) {
// Account and key or credentials or anonymous
storageServiceSettings = StorageServiceSettings.createExplicitly(storageAccountOrConnectionString, storageAccessKey, host, sasToken, endpointSuffix);
storageServiceSettings = StorageServiceSettings.createExplicitly(storageAccountOrConnectionString, storageAccessKey, host, sas, endpointSuffix, token);
} else {

@@ -914,0 +921,0 @@ // Use environment variables

@@ -29,2 +29,3 @@ //

var SR = require('../util/sr');
var TokenCredential = require('../models/tokencredential');

@@ -37,2 +38,3 @@ var useDevelopmentStorageSetting = ServiceSettings.setting(ConnectionStringKeys.USE_DEVELOPMENT_STORAGE_NAME, true);

var sasSetting = ServiceSettings.settingWithFunc(ConnectionStringKeys.SHARED_ACCESS_SIGNATURE_NAME, _.isString);
var tokenSetting = ServiceSettings.settingWithFunc('token', function (object) {return object instanceof TokenCredential;});

@@ -89,4 +91,5 @@ var blobEndpointSetting = ServiceSettings.settingWithFunc(

* @param {bool} usePathStyleUri Boolean value indicating wether to use path style uri or not.
* @param {TokenCredential} [token] The {@link TokenCredential} object.
*/
function StorageServiceSettings(name, key, sasToken, blobEndpoint, queueEndpoint, tableEndpoint, fileEndpoint, usePathStyleUri) {
function StorageServiceSettings(name, key, sasToken, blobEndpoint, queueEndpoint, tableEndpoint, fileEndpoint, usePathStyleUri, token) {
this._name = name;

@@ -111,2 +114,4 @@ this._key = key;

}
this._token = token;
}

@@ -135,3 +140,3 @@

StorageServiceSettings.createExplicitly = function (storageAccount, storageAccessKey, host, sasToken, endpointSuffix) {
StorageServiceSettings.createExplicitly = function (storageAccount, storageAccessKey, host, sasToken, endpointSuffix, token) {
var settings = {};

@@ -160,2 +165,3 @@ function addIfNotNullOrEmpty(key, value){

addIfNotNullOrEmpty('endpointsuffix', endpointSuffix);
addIfNotNullOrEmpty('token', token);

@@ -287,2 +293,20 @@ return StorageServiceSettings.createFromSettings(settings);

// Token case
matchedSpecs = ServiceSettings.matchedSpecification(
settings,
ServiceSettings.allRequired(
tokenSetting
),
ServiceSettings.atLeastOne(
blobEndpointSetting,
queueEndpointSetting,
tableEndpointSetting,
fileEndpointSetting
)
);
if(matchedSpecs) {
return this._createStorageServiceSettings(settings);
}
ServiceSettings.noMatchSettings(settings);

@@ -389,2 +413,7 @@ };

var token = util.tryGetValueInsensitive(
'token',
settings
);
var blobEndpoint = standardizeHost(

@@ -422,3 +451,4 @@ util.tryGetValueInsensitive(ConnectionStringKeys.BLOB_ENDPOINT_NAME, settings),

tableEndpoint,
fileEndpoint
fileEndpoint,
token
);

@@ -425,0 +455,0 @@ };

@@ -165,4 +165,4 @@ //

*
* @param {WebResource} The webresource to be signed.
* @param {function(error)} callback The callback function.
* @param {WebResource} webResource The webresource to be signed.
* @param {function(error)} callback The callback function.
*/

@@ -169,0 +169,0 @@ SharedKey.prototype.signRequest = function (webResource, callback) {

@@ -17,2 +17,3 @@ //

var EventEmitter = require('events');
var util = require('util');

@@ -22,3 +23,4 @@ var azureutil = require('../util/util');

/**
* Blob upload/download speed summary
* Blob upload/download speed summary.
* Trigger 'progress' event every progress updates.
*/

@@ -37,2 +39,4 @@ function SpeedSummary (name) {

util.inherits(SpeedSummary, EventEmitter);
/**

@@ -142,2 +146,8 @@ * Convert the size to human readable size

this._recordSpeed(len);
var that = this;
process.nextTick(function () {
that.emit('progress');
});
return this.completeSize;

@@ -144,0 +154,0 @@ };

@@ -40,3 +40,3 @@ //

*/
USER_AGENT_PRODUCT_VERSION: '2.8.3',
USER_AGENT_PRODUCT_VERSION: '2.9.0-preview',

@@ -976,3 +976,3 @@ /**

/**
* The Last-Modified header
* The Last-Modified header.
*

@@ -985,2 +985,10 @@ * @const

/**
* The creation time header.
*
* @const
* @type {string}
*/
CREATION_TIME: 'x-ms-creation-time',
/**
* The data service version.

@@ -1050,2 +1058,18 @@ *

/**
* The header that specifies container immutability policy.
*
* @const
* @type {boolean}
*/
HAS_IMMUTABILITY_POLICY: 'x-ms-has-immutability-policy',
/**
* The header that specifies container has legal hold.
*
* @const
* @type {boolean}
*/
HAS_LEGAL_HOLD: 'x-ms-has-legal-hold',
/**
* The header for the blob type.

@@ -1688,3 +1712,3 @@ *

*/
TARGET_STORAGE_VERSION: '2017-07-29',
TARGET_STORAGE_VERSION: '2017-11-09',

@@ -1691,0 +1715,0 @@ /**

@@ -206,3 +206,3 @@ //

if (!nameError || containerName.match(/^(\$root|\$logs)$/)) {
if (!nameError || containerName.match(/^(\$root|\$logs|\$web)$/)) {
callback();

@@ -209,0 +209,0 @@ return true;

@@ -118,2 +118,3 @@ //

'lastModified': 'LAST_MODIFIED',
'creationTime': 'CREATION_TIME',
'etag': 'ETAG',

@@ -120,0 +121,0 @@ 'sequenceNumber': 'SEQUENCE_NUMBER',

@@ -77,2 +77,12 @@ //

// convert hasImmutabilityPolicy to boolean type
if (containerResult.hasImmutabilityPolicy !== undefined) {
containerResult.hasImmutabilityPolicy = (containerResult.hasImmutabilityPolicy === 'true');
}
// convert hasLegalHold to boolean type
if (containerResult.hasLegalHold !== undefined) {
containerResult.hasLegalHold = (containerResult.hasLegalHold === 'true');
}
return containerResult;

@@ -96,3 +106,15 @@ };

setContainerPropertyFromHeaders('requestId', HeaderConstants.REQUEST_ID);
setContainerPropertyFromHeaders('hasImmutabilityPolicy', HeaderConstants.HAS_IMMUTABILITY_POLICY);
setContainerPropertyFromHeaders('hasLegalHold', HeaderConstants.HAS_LEGAL_HOLD);
// convert hasImmutabilityPolicy to boolean type
if (self.hasImmutabilityPolicy !== undefined) {
self.hasImmutabilityPolicy = (self.hasImmutabilityPolicy === 'true');
}
// convert hasLegalHold to boolean type
if (self.hasLegalHold !== undefined) {
self.hasLegalHold = (self.hasLegalHold === 'true');
}
if (!self.publicAccessLevel) {

@@ -99,0 +121,0 @@ self.publicAccessLevel = BlobUtilities.BlobContainerPublicAccessType.OFF;

{
"name": "azure-storage",
"author": "Microsoft Corporation",
"version": "2.8.3",
"version": "2.9.0-preview",
"description": "Microsoft Azure Storage Client Library for Node.js",

@@ -6,0 +6,0 @@ "typings": "typings/azure-storage/azure-storage.d.ts",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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

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

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

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