From 793375bd5ee0904ebfd3cf21de05201c733ac562 Mon Sep 17 00:00:00 2001 From: Junle Li Date: Mon, 26 Jun 2017 22:20:20 +0800 Subject: [PATCH 01/10] Fix the typo in the table query example. --- lib/services/table/tablequery.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/services/table/tablequery.js b/lib/services/table/tablequery.js index acf1a573..f88e119d 100644 --- a/lib/services/table/tablequery.js +++ b/lib/services/table/tablequery.js @@ -241,7 +241,7 @@ TableQuery.stringFilter = function (propertyName, operation, value) { * @example * var filter1 = TableQuery.stringFilter('Name', QueryComparisons.EQUAL, 'Person'); * var filter2 = TableQuery.booleanFilter('Visible', QueryComparisons.EQUAL, true); - * var combinedFilter = TableQuery.combineFilters(filter1, TablUtilities.TableOperators.AND, filter2); + * var combinedFilter = TableQuery.combineFilters(filter1, TableUtilities.TableOperators.AND, filter2); */ TableQuery.combineFilters = function (filterA, operatorString, filterB) { return filterA + ' ' + operatorString + ' ' + filterB; @@ -416,4 +416,4 @@ TableQuery._replaceOperators = function (whereClause) { return encodedWhereClause; }; -module.exports = TableQuery; \ No newline at end of file +module.exports = TableQuery; From 398c0367d1ac478a163e4dc44bb7d518b5823d4d Mon Sep 17 00:00:00 2001 From: Samuel Date: Thu, 6 Jul 2017 13:31:06 +0200 Subject: [PATCH 02/10] chore(package): update request to 2.81.0 Currently, we pull a version of request that comes with some known-to-be-vulnerable dependency -- see https://snyk.io/test/npm/azure-storage Trying to address this, bumping request to 2.81.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 05a4435c..ee91ea7a 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "json-edm-parser": "0.1.2", "md5.js": "1.3.4", "readable-stream": "~2.0.0", - "request": "~2.74.0", + "request": "~2.81.0", "underscore": "~1.8.3", "uuid": "^3.0.0", "validator": "~3.35.0", From 9807ad9d69b57ac42884300531af93c964cd3b69 Mon Sep 17 00:00:00 2001 From: roadman Date: Thu, 29 Jun 2017 16:47:53 +0900 Subject: [PATCH 03/10] add .d.ts FileUtilities.SharedAccessPermissions --- typings/azure-storage/azure-storage.d.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/typings/azure-storage/azure-storage.d.ts b/typings/azure-storage/azure-storage.d.ts index e9d0d60e..08bbfd9f 100644 --- a/typings/azure-storage/azure-storage.d.ts +++ b/typings/azure-storage/azure-storage.d.ts @@ -7226,6 +7226,14 @@ declare module azurestorage { // ./services/file/fileutilities // ########################### export module FileUtilities { + var SharedAccessPermissions: { + READ: string; + CREATE: string; + WRITE: string; + DELETE: string; + LIST: string; + }; + var ListingDetails: { METADATA: string; }; @@ -9125,4 +9133,4 @@ declare module azurestorage { export import RetryPolicyFilter = common.filters.retrypolicyfilter.RetryPolicyFilter; } -export = azurestorage; \ No newline at end of file +export = azurestorage; From e66295fa67b1fcecc98697334a6d8fadb907ce01 Mon Sep 17 00:00:00 2001 From: Xiaoning Liu Date: Thu, 1 Jun 2017 18:27:59 +0800 Subject: [PATCH 04/10] For Premium Accounts only, added support for getting and setting the tier on a page blob. The tier can also be set when creating or copying from an existing page blob. --- ChangeLog.md | 8 + lib/common/util/constants.js | 21 +- lib/common/util/validate.js | 30 + lib/services/blob/blobservice.core.js | 64 +- lib/services/blob/blobservice.node.js | 4 +- lib/services/blob/blobutilities.js | 28 +- lib/services/blob/models/blobresult.js | 10 +- test/accountsas-tests.js | 4 +- test/common/sharedkey-tests.js | 4 +- test/framework/test-suite.js | 18 +- .../blob-archive-pageblob-tests.nock.js | 2015 +++++++++++++++++ .../blob/blobservice-archive-tests.js | 243 ++ test/services/blob/blobservice-tests.js | 6 +- test/services/file/fileservice-file-tests.js | 2 +- test/services/file/fileservice-share-tests.js | 2 +- test/services/queue/queueservice-tests.js | 4 +- test/services/table/tableservice-tests.js | 4 +- typings/azure-storage/azure-storage.d.ts | 45 +- 18 files changed, 2489 insertions(+), 23 deletions(-) create mode 100644 test/recordings/blob-archive-pageblob-tests.nock.js create mode 100644 test/services/blob/blobservice-archive-tests.js diff --git a/ChangeLog.md b/ChangeLog.md index 6ba9c0cd..137cc3ef 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,6 +1,14 @@ 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. +2017.08 Version 2.3.0 + +ALL +* Updated storage service version to 2017-04-17. Fore more information, please see - https://docs.microsoft.com/en-us/rest/api/storageservices/versioning-for-the-azure-storage-services + +BLOB +* PageBlobs: For Premium Accounts only, added support for getting and setting the tier on a page blob. The tier can also be set when creating or copying from an existing page blob. + 2017.08 Version 2.2.2 ALL diff --git a/lib/common/util/constants.js b/lib/common/util/constants.js index daf14afb..adf427b9 100644 --- a/lib/common/util/constants.js +++ b/lib/common/util/constants.js @@ -1627,7 +1627,7 @@ var Constants = { * @const * @type {string} */ - TARGET_STORAGE_VERSION: '2016-05-31', + TARGET_STORAGE_VERSION: '2017-04-17', /** * The UserAgent header. @@ -1756,6 +1756,25 @@ var Constants = { * @type {bool} */ SERVER_ENCRYPTED: 'x-ms-server-encrypted', + + /** + * Header indicates the resulting tier of the blob. + * + * @const + * @type {string} + */ + ACCESS_TIER: 'x-ms-access-tier', + + /** + * For page blobs on premium accounts only. + * If the access tier is not explicitly set on the blob, + * the tier is inferred based on its content length + * and this header will be returned with true value. + * + * @const + * @type {string} + */ + ACCESS_TIER_INFERRED: 'x-ms-access-tier-inferred' }, QueryStringConstants: { diff --git a/lib/common/util/validate.js b/lib/common/util/validate.js index dd07d3af..87efc1b7 100644 --- a/lib/common/util/validate.js +++ b/lib/common/util/validate.js @@ -19,6 +19,7 @@ var util = require('util'); var constants = require('./../util/constants'); var blobConstants = constants.BlobConstants; +var BlobUtilities = require('./../../services/blob/blobutilities'); var FileUtilities = require('./../../services/file/fileutilities'); var azureutil = require('./util'); var SR = require('./sr'); @@ -236,6 +237,34 @@ exports.blobNameIsValid = function (containerName, blobName, callback) { return true; }; +/** +* Validates a blob tier name. +* +* @param {string} blobTier The blob tier name. +*/ +exports.blobTierNameIsValid = function (blobTier, callback) { + var fail; + + initCallback(callback, function (f, cb) { + fail = f; + callback = cb; + }); + + if (!blobTier) { + return fail(new ArgumentNullError('blobTier', 'Blob tier is not specified.')); + } + + if (!_.chain(_.union(_.values(BlobUtilities.BlobTier.PremiumPageBlobTier))) + .map(function (val) { return val.toString().toUpperCase(); }) + .contains(blobTier.toString().toUpperCase()) + .value()) { + return fail(new SyntaxError('Blob tier is incorrect. Refer to BlobUtilities.BlobTier for possible values.')); + } + + callback(); + return true; +}; + /** * Validates a share name. * @@ -510,6 +539,7 @@ _.extend(ArgumentValidator.prototype, { containerNameIsValid: exports.containerNameIsValid, shareNameIsValid: exports.shareNameIsValid, blobNameIsValid: exports.blobNameIsValid, + blobTierNameIsValid: exports.blobTierNameIsValid, pageRangesAreValid: exports.pageRangesAreValid, queueNameIsValid: exports.queueNameIsValid, blobTypeIsValid: exports.blobTypeIsValid, diff --git a/lib/services/blob/blobservice.core.js b/lib/services/blob/blobservice.core.js index 27b7fb19..35b42a83 100644 --- a/lib/services/blob/blobservice.core.js +++ b/lib/services/blob/blobservice.core.js @@ -239,6 +239,59 @@ BlobService.prototype.setServiceProperties = function (serviceProperties, option return this.setAccountServiceProperties(serviceProperties, optionsOrCallback, callback); }; +/** +* Sets the tier of a pageblob under a premium storage account. +* +* @this {BlobService} +* @param {string} container The container name. +* @param {string} blob The blob name. +* @param {string} blobTier Please see BlobUtilities.BlobTier.PremiumPageBlobTier for possible values. +* @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. +* Please see StorageUtilities.LocationMode for the possible values. +* @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. +* @param {int} [options.clientRequestTimeoutInMs] The timeout of client requests, in milliseconds, to use for the request. +* @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request. +* The maximum execution time interval begins at the time that the client begins building the request. The maximum +* execution time is checked intermittently while performing requests, and before executing retries. +* @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit. +* @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. +* The default value is false. +* @param {errorOrResponse} callback `error` will contain information +* if an error occurs; otherwise, `response` +* will contain information related to this operation. +*/ +BlobService.prototype.setBlobTier = function (container, blob, blobTier, optionsOrCallback, callback) { + var userOptions; + azureutil.normalizeArgs(optionsOrCallback, callback, function (o, c) { userOptions = o; callback = c; }); + + validate.validateArgs('setBlobTier', function (v) { + v.string(container, 'container'); + v.string(blob, 'blob'); + v.string(blobTier, 'blobTier'); + v.containerNameIsValid(container); + v.blobNameIsValid(container, blob); + v.blobTierNameIsValid(blobTier); + v.callback(callback); + }); + + var options = extend(true, {}, userOptions); + + var resourceName = createResourceName(container, blob); + var webResource = WebResource.put(resourceName) + .withQueryOption(QueryStringConstants.COMP, 'tier') + .withHeader(HeaderConstants.ACCESS_TIER, blobTier); + + var processResponseCallback = function (responseObject, next) { + var finalCallback = function (returnObject) { + callback(returnObject.error, returnObject.response); + }; + + next(responseObject, finalCallback); + }; + + this.performRequest(webResource, null, options, processResponseCallback); +}; + /** * Lists a segment containing a collection of container items under the specified account. * @@ -2016,6 +2069,7 @@ BlobService.prototype.createBlobSnapshot = function (container, blob, optionsOrC * @param {string} targetContainer The target container name. * @param {string} targetBlob The target blob name. * @param {object} [options] The request options. +* @param {string} [options.blobTier] For page blobs on premium accounts only. Set the tier of target blob. Refer to BlobUtilities.BlobTier.PremiumPageBlobTier. * @param {boolean} [options.isIncrementalCopy] If it's incremental copy or not. Refer to https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/incremental-copy-blob * @param {string} [options.snapshotId] The source blob snapshot identifier. * @param {object} [options.metadata] The target blob metadata key/value pairs. @@ -2073,6 +2127,7 @@ BlobService.prototype.startCopyBlob = function (sourceUri, targetContainer, targ webResource.withQueryOption(QueryStringConstants.COMP, 'incrementalcopy'); } + webResource.withHeader(HeaderConstants.ACCESS_TIER, options.blobTier); webResource.withHeader(HeaderConstants.LEASE_ID, options.leaseId); webResource.withHeader(HeaderConstants.SOURCE_LEASE_ID, options.sourceLeaseId); webResource.addOptionalMetadataHeaders(options.metadata); @@ -2284,6 +2339,7 @@ BlobService.prototype.getUrl = function (container, blob, sasToken, primary, sna * @param {object} [options] The request options. * @param {object} [options.metadata] The metadata key/value pairs. * @param {string} [options.leaseId] The target blob lease identifier. +* @param {string} [options.blobTier] For page blobs on premium accounts only. Set the tier of the target blob. Refer to BlobUtilities.BlobTier.PremiumPageBlobTier. * @param {object} [options.contentSettings] The content settings of the blob. * @param {string} [options.contentSettings.contentType] The MIME content type of the blob. The default type is application/octet-stream. * @param {string} [options.contentSettings.contentEncoding] The content encodings that have been applied to the blob. @@ -2331,6 +2387,7 @@ BlobService.prototype.createPageBlob = function (container, blob, length, option .withHeader(HeaderConstants.BLOB_TYPE, BlobConstants.BlobTypes.PAGE) .withHeader(HeaderConstants.BLOB_CONTENT_LENGTH, length) .withHeader(HeaderConstants.CONTENT_LENGTH, 0) + .withHeader(HeaderConstants.ACCESS_TIER, options.blobTier) .withHeader(HeaderConstants.LEASE_ID, options.leaseId); BlobResult.setHeadersFromBlob(webResource, options); @@ -2364,6 +2421,7 @@ BlobService.prototype.createPageBlob = function (container, blob, length, option * @param {bool} [options.storeBlobContentMD5] Specifies whether the blob's ContentMD5 header should be set on uploads. * The default value is false for page blobs. * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions. +* @param {string} [options.blobTier] For page blobs on premium accounts only. Set the tier of the target blob. Refer to BlobUtilities.BlobTier.PremiumPageBlobTier. * @param {object} [options.contentSettings] The content settings of the blob. * @param {string} [options.contentSettings.contentType] The MIME content type of the blob. The default type is application/octet-stream. * @param {string} [options.contentSettings.contentEncoding] The content encodings that have been applied to the blob. @@ -2457,6 +2515,7 @@ BlobService.prototype.createWriteStreamToExistingPageBlob = function (container, * @param {bool} [options.storeBlobContentMD5] Specifies whether the blob's ContentMD5 header should be set on uploads. * The default value is false for page blobs and true for block blobs. * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions. +* @param {string} [options.blobTier] For page blobs on premium accounts only. Set the tier of the target blob. Refer to BlobUtilities.BlobTier.PremiumPageBlobTier. * @param {object} [options.contentSettings] The content settings of the blob. * @param {string} [options.contentSettings.contentType] The MIME content type of the blob. The default type is application/octet-stream. * @param {string} [options.contentSettings.contentEncoding] The content encodings that have been applied to the blob. @@ -3875,6 +3934,7 @@ BlobService.prototype.appendBlockFromText = function (container, blob, content, * @param {int} [options.parallelOperationThreadCount] The number of parallel operations that may be performed when uploading. * @param {bool} [options.storeBlobContentMD5] Specifies whether the blob's ContentMD5 header should be set on uploads. The default value is true for block blobs. * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions. +* @param {string} [options.blobTier] For page blobs on premium accounts only. Set the tier of the target blob. Refer to BlobUtilities.BlobTier.PremiumPageBlobTier. * @param {object} [options.contentSettings] The content settings of the blob. * @param {string} [options.contentSettings.contentType] The MIME content type of the blob. The default type is application/octet-stream. * @param {string} [options.contentSettings.contentEncoding] The content encodings that have been applied to the blob. @@ -4018,6 +4078,7 @@ BlobService.prototype._createBlobFromText = function (container, blob, blobType, * @param {bool} [options.storeBlobContentMD5] Specifies whether the blob's ContentMD5 header should be set on uploads. * The default value is false for page blobs and true for block blobs. * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions. +* @param {string} [options.blobTier] For page blobs on premium accounts only. Set the tier of the target blob. Refer to BlobUtilities.BlobTier.PremiumPageBlobTier. * @param {object} [options.contentSettings] The content settings of the blob. * @param {string} [options.contentSettings.contentType] The MIME content type of the blob. The default type is application/octet-stream. * @param {string} [options.contentSettings.contentEncoding] The content encodings that have been applied to the blob. @@ -5552,9 +5613,10 @@ BlobService.prototype._listBlobsOrDircotriesSegmentedWithPrefix = function (cont * @this {BlobService} * @param {string} container The container name. * @param {string} blob The blob name. -* @param (BlobType) blobType The blob type. +* @param {BlobType} blobType The blob type. * @param {int} size The blob size. * @param {object} [options] The request options. +* @param {string} [options.blobTier] For page blobs on premium accounts only. Set the tier of the target blob. Refer to BlobUtilities.BlobTier.PremiumPageBlobTier. * @param {errorOrResult} callback The callback which operates on the specific blob. */ BlobService.prototype._createBlob = function (container, blob, blobType, size, options, creationCallback) { diff --git a/lib/services/blob/blobservice.node.js b/lib/services/blob/blobservice.node.js index d2f65e09..e533ba00 100644 --- a/lib/services/blob/blobservice.node.js +++ b/lib/services/blob/blobservice.node.js @@ -95,7 +95,7 @@ BlobService.prototype.getBlobToLocalFile = function (container, blob, localFileN * @this {BlobService} * @param {string} container The container name. * @param {string} blob The blob name. -* @param (string) localFileName The local path to the file to be uploaded. +* @param {string} localFileName The local path to the file to be uploaded. * @param {object} [options] The request options. * @param {SpeedSummary} [options.speedSummary] The upload tracker objects. * @param {int} [options.parallelOperationThreadCount] The number of parallel operations that may be performed when uploading. @@ -105,6 +105,7 @@ BlobService.prototype.getBlobToLocalFile = function (container, blob, localFileN * @param {bool} [options.storeBlobContentMD5] Specifies whether the blob's ContentMD5 header should be set on uploads. * The default value is false for page blobs. * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions. +* @param {string} [options.blobTier] For page blobs on premium accounts only. Set the tier of the target blob. Refer to BlobUtilities.BlobTier.PremiumPageBlobTier. * @param {object} [options.contentSettings] The content settings of the blob. * @param {string} [options.contentSettings.contentType] The MIME content type of the blob. The default type is application/octet-stream. * @param {string} [options.contentSettings.contentEncoding] The content encodings that have been applied to the blob. @@ -318,6 +319,7 @@ BlobService.prototype.appendFromLocalFile = function (container, blob, localFile * @param {object} [options.metadata] The metadata key/value pairs. * @param {int} [options.parallelOperationThreadCount] The number of parallel operations that may be performed when uploading. * @param {bool} [options.storeBlobContentMD5] Specifies whether the blob's ContentMD5 header should be set on uploads. The default value is true for block blobs. +* @param {string} [options.blobTier] For page blobs on premium accounts only. Set the tier of the target blob. Refer to BlobUtilities.BlobTier.PremiumPageBlobTier. * @param {object} [options.contentSettings] The content settings of the blob. * @param {string} [options.contentSettings.contentType] The MIME content type of the blob. The default type is application/octet-stream. * @param {string} [options.contentSettings.contentEncoding] The content encodings that have been applied to the blob. diff --git a/lib/services/blob/blobutilities.js b/lib/services/blob/blobutilities.js index e13998ae..10464c35 100644 --- a/lib/services/blob/blobutilities.js +++ b/lib/services/blob/blobutilities.js @@ -88,12 +88,38 @@ var BlobUtilities = { /** * Describes actions that can be performed on a page blob sequence number. * @const - * @enum + * @enum {string} */ SequenceNumberAction: { MAX: 'max', UPDATE: 'update', INCREMENT: 'increment' + }, + + /** + * Candidate values for blob tiers. + * + * @property {object} PremiumPageBlobTier Candidate values for premium pageblob tiers. + * @property {string} PremiumPageBlobTier.P4 + * @property {string} PremiumPageBlobTier.P6 + * @property {string} PremiumPageBlobTier.P10 + * @property {string} PremiumPageBlobTier.P20 + * @property {string} PremiumPageBlobTier.P30 + * @property {string} PremiumPageBlobTier.P40 + * @property {string} PremiumPageBlobTier.P50 + * @property {string} PremiumPageBlobTier.P60 + */ + BlobTier: { + PremiumPageBlobTier: { + P4: 'P4', + P6: 'P6', + P10: 'P10', + P20: 'P20', + P30: 'P30', + P40: 'P40', + P50: 'P50', + P60: 'P60' + } } }; diff --git a/lib/services/blob/models/blobresult.js b/lib/services/blob/models/blobresult.js index 2cfcebfe..aad61af2 100644 --- a/lib/services/blob/models/blobresult.js +++ b/lib/services/blob/models/blobresult.js @@ -1,4 +1,4 @@ -// +// // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -119,6 +119,9 @@ var headersForProperties = { 'acceptRanges': 'ACCEPT_RANGES', 'appendOffset': 'BLOB_APPEND_OFFSET', + 'accessTier': 'ACCESS_TIER', + 'accessTierInferred': 'ACCESS_TIER_INFERRED', + 'isIncrementalCopy': 'INCREMENTAL_COPY', // ContentSettings @@ -173,6 +176,11 @@ BlobResult.prototype.getPropertiesFromHeaders = function (headers) { if (self.isIncrementalCopy !== undefined) { self.isIncrementalCopy = (self.isIncrementalCopy == 'true'); } + + // convert accessTierInferred to boolean type + if (self.accessTierInferred !== undefined) { + self.accessTierInferred = (self.accessTierInferred == 'true'); + } }; /** diff --git a/test/accountsas-tests.js b/test/accountsas-tests.js index 8542e0d9..fe37f2fb 100644 --- a/test/accountsas-tests.js +++ b/test/accountsas-tests.js @@ -1438,7 +1438,7 @@ describe('azure', function () { assert.equal(sasQueryString[QueryStringConstants.SIGNED_PROTOCOL], sharedAccessPolicy.AccessPolicy.Protocols); assert.equal(sasQueryString[QueryStringConstants.SIGNED_IP], sharedAccessPolicy.AccessPolicy.IPAddressOrRange); assert.equal(sasQueryString[QueryStringConstants.SIGNED_VERSION], HeaderConstants.TARGET_STORAGE_VERSION); - assert.equal(sasQueryString[QueryStringConstants.SIGNATURE], '7VtSRqLUacnKpNF0JJQSj1Ql8mvCKDdAtgH9azXc8L8='); + assert.equal(sasQueryString[QueryStringConstants.SIGNATURE], 'CKZNTDjlltaA0mwrdaPfmGtgxgiQLoKoJSF0uILYqu0='); process.env[StorageServiceClientConstants.EnvironmentVariables.AZURE_STORAGE_CONNECTION_STRING] = connString; done(); @@ -1470,7 +1470,7 @@ describe('azure', function () { assert.equal(sasQueryString[QueryStringConstants.SIGNED_PROTOCOL], sharedAccessPolicy.AccessPolicy.Protocols); assert.equal(sasQueryString[QueryStringConstants.SIGNED_IP], sharedAccessPolicy.AccessPolicy.IPAddressOrRange); assert.equal(sasQueryString[QueryStringConstants.SIGNED_VERSION], HeaderConstants.TARGET_STORAGE_VERSION); - assert.equal(sasQueryString[QueryStringConstants.SIGNATURE], '7VtSRqLUacnKpNF0JJQSj1Ql8mvCKDdAtgH9azXc8L8='); + assert.equal(sasQueryString[QueryStringConstants.SIGNATURE], 'CKZNTDjlltaA0mwrdaPfmGtgxgiQLoKoJSF0uILYqu0='); done(); }); diff --git a/test/common/sharedkey-tests.js b/test/common/sharedkey-tests.js index b315fc88..f5bc33a4 100644 --- a/test/common/sharedkey-tests.js +++ b/test/common/sharedkey-tests.js @@ -48,7 +48,7 @@ describe('sharedkey-tests', function () { webResource.withHeader(HeaderConstants.MS_DATE, 'Fri, 23 Sep 2011 01:37:34 GMT'); sharedkey.signRequest(webResource, function () { - assert.equal(webResource.headers[HeaderConstants.AUTHORIZATION], 'SharedKey devstoreaccount1:+BPqJb08vDu2qpM43bvpBbebyfVf5uZow+tOkqbbKWw='); + assert.equal(webResource.headers[HeaderConstants.AUTHORIZATION], 'SharedKey devstoreaccount1:phWLwBDQmLRuhOCKblR0+k6+6N/EpF236K5KID6VXx8='); done(); }); @@ -80,7 +80,7 @@ describe('sharedkey-tests', function () { assert.equal(sasQueryString[QueryStringConstants.SIGNED_PROTOCOL], sharedAccessPolicy.AccessPolicy.Protocols); assert.equal(sasQueryString[QueryStringConstants.SIGNED_IP], sharedAccessPolicy.AccessPolicy.IPAddressOrRange); assert.equal(sasQueryString[QueryStringConstants.SIGNED_VERSION], HeaderConstants.TARGET_STORAGE_VERSION); - assert.equal(sasQueryString[QueryStringConstants.SIGNATURE], 'kb1m7JjHBcB2eXle9m/jzNXyLh3cCA2VvHWM+A9My8k='); + assert.equal(sasQueryString[QueryStringConstants.SIGNATURE], '4J76vq0uIO2nuRsgVPA2bJiKdKTmDfeghzumaLhOPas='); done(); }); diff --git a/test/framework/test-suite.js b/test/framework/test-suite.js index 165872dc..cee0d45c 100644 --- a/test/framework/test-suite.js +++ b/test/framework/test-suite.js @@ -33,7 +33,15 @@ function TestSuite(testPrefix, env, forceMocked) { return connectionString.replace(/AccountKey=[^;]+/, 'AccountKey=null'); } - var requiredEnvironment = [{ name: 'AZURE_STORAGE_CONNECTION_STRING', secure: stripAccessKey }]; + var requiredEnvironment = [{ + name: 'AZURE_STORAGE_CONNECTION_STRING', + secure: stripAccessKey, + optional: false + },{ + name: 'AZURE_STORAGE_CONNECTION_STRING_PREMIUM_ACCOUNT', + secure: stripAccessKey, + optional: true + }]; env = env.concat(requiredEnvironment); this.testPrefix = testPrefix; @@ -44,10 +52,12 @@ function TestSuite(testPrefix, env, forceMocked) { if (forceMocked) { this.isMocked = true; } else { - this.isMocked = testPrefix && !process.env.NOCK_OFF; + var nockOff = process.env.NOCK_OFF === 'true'; + this.isMocked = testPrefix && !nockOff; } - this.isRecording = process.env.AZURE_NOCK_RECORD; + this.isRecording = process.env.AZURE_NOCK_RECORD === 'true'; + this.skipSubscription = true; var nodeVersion = Number(process.version.match(/^v(\d+\.\d+)/)[1]); @@ -96,7 +106,7 @@ _.extend(TestSuite.prototype, { var messages = []; var missing = []; this.requiredEnvironment.forEach(function (e) { - if (!process.env[e.name] && !e.defaultValue) { + if (!process.env[e.name] && !e.defaultValue && !e.optional) { missing.push(e.name); } }); diff --git a/test/recordings/blob-archive-pageblob-tests.nock.js b/test/recordings/blob-archive-pageblob-tests.nock.js new file mode 100644 index 00000000..2238e03c --- /dev/null +++ b/test/recordings/blob-archive-pageblob-tests.nock.js @@ -0,0 +1,2015 @@ +// This file has been autogenerated. + +exports.setEnvironment = function() { + process.env['AZURE_STORAGE_CONNECTION_STRING'] = 'DefaultEndpointsProtocol=https;AccountName=browserifytest2;AccountKey=null;EndpointSuffix=core.windows.net'; + process.env['AZURE_STORAGE_CONNECTION_STRING_PREMIUM_ACCOUNT'] = 'DefaultEndpointsProtocol=https;AccountName=xiaonliprepp;AccountKey=null;EndpointSuffix=rr1xio.xstore-test.windows-int.net'; +} + +exports.scopes = [[function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata0?restype=container') + .reply(404, "", { vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '12fffbe9-001c-0007-15ab-ff9671000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:36 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata0?restype=container') + .reply(404, "", { vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '12fffbe9-001c-0007-15ab-ff9671000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:36 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata0?restype=container') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:51:38 GMT', + etag: '"0x8D4CDC29571305A"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '5f3e5458-001c-000d-66ab-ff2465000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:38 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata0?restype=container') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:51:38 GMT', + etag: '"0x8D4CDC29571305A"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '5f3e5458-001c-000d-66ab-ff2465000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:38 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata0/archive-blob-testdata1') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:51:38 GMT', + etag: '"0x8D4CDC295E26D63"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': 'd0130a43-001c-0000-69ab-ff1500000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:38 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata0/archive-blob-testdata1') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:51:38 GMT', + etag: '"0x8D4CDC295E26D63"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': 'd0130a43-001c-0000-69ab-ff1500000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:38 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata0/archive-blob-testdata1') + .reply(200, "", { 'content-length': '0', + 'content-type': 'application/octet-stream', + 'last-modified': 'Tue, 18 Jul 2017 09:51:38 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D4CDC295E26D63"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-access-tier': 'P10', + 'x-ms-access-tier-inferred': 'true', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-blob-type': 'PageBlob', + 'x-ms-blob-sequence-number': '0', + 'x-ms-server-encrypted': 'false', + 'x-ms-request-id': 'fe9fbb11-001c-0011-33ab-ff28a3000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:41 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata0/archive-blob-testdata1') + .reply(200, "", { 'content-length': '0', + 'content-type': 'application/octet-stream', + 'last-modified': 'Tue, 18 Jul 2017 09:51:38 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D4CDC295E26D63"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-access-tier': 'P10', + 'x-ms-access-tier-inferred': 'true', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-blob-type': 'PageBlob', + 'x-ms-blob-sequence-number': '0', + 'x-ms-server-encrypted': 'false', + 'x-ms-request-id': 'fe9fbb11-001c-0011-33ab-ff28a3000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:41 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata0?restype=container') + .reply(200, "", { 'last-modified': 'Tue, 18 Jul 2017 09:51:38 GMT', + etag: '"0x8D4CDC29571305A"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-request-id': 'b511f769-001c-000c-5eab-ffc918000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:41 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata0?restype=container') + .reply(200, "", { 'last-modified': 'Tue, 18 Jul 2017 09:51:38 GMT', + etag: '"0x8D4CDC29571305A"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-request-id': 'b511f769-001c-000c-5eab-ffc918000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:41 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .delete('/archive-cont-testdata0?restype=container') + .reply(202, "", { server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '4646bf9b-001c-0004-61ab-ffa1f7000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:42 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .delete('/archive-cont-testdata0?restype=container') + .reply(202, "", { server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '4646bf9b-001c-0004-61ab-ffa1f7000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:42 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }], +[function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata2?restype=container') + .reply(404, "", { vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'e6a6c26c-001c-0006-48ab-ff7b0c000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:44 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata2?restype=container') + .reply(404, "", { vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'e6a6c26c-001c-0006-48ab-ff7b0c000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:44 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata2?restype=container') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:51:45 GMT', + etag: '"0x8D4CDC299FBC00B"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '2266a06f-001c-0005-7eab-ff4c8a000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:45 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata2?restype=container') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:51:45 GMT', + etag: '"0x8D4CDC299FBC00B"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '2266a06f-001c-0005-7eab-ff4c8a000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:45 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata2/archive-blob-testdata3') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:51:46 GMT', + etag: '"0x8D4CDC29A57B04A"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': '9193515f-001c-0014-6cab-ff7129000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:45 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata2/archive-blob-testdata3') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:51:46 GMT', + etag: '"0x8D4CDC29A57B04A"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': '9193515f-001c-0014-6cab-ff7129000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:45 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata2/archive-blob-testdata3?comp=tier') + .reply(200, "", { server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '81ad73cc-001c-0003-08ab-ff2286000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:47 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata2/archive-blob-testdata3?comp=tier') + .reply(200, "", { server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '81ad73cc-001c-0003-08ab-ff2286000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:47 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata2/archive-blob-testdata3') + .reply(200, "", { 'content-length': '0', + 'content-type': 'application/octet-stream', + 'last-modified': 'Tue, 18 Jul 2017 09:51:46 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D4CDC29A57B04A"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-access-tier': 'P4', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-blob-type': 'PageBlob', + 'x-ms-blob-sequence-number': '0', + 'x-ms-server-encrypted': 'false', + 'x-ms-request-id': '31edce17-001c-0002-43ab-ffcffb000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:48 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata2/archive-blob-testdata3') + .reply(200, "", { 'content-length': '0', + 'content-type': 'application/octet-stream', + 'last-modified': 'Tue, 18 Jul 2017 09:51:46 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D4CDC29A57B04A"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-access-tier': 'P4', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-blob-type': 'PageBlob', + 'x-ms-blob-sequence-number': '0', + 'x-ms-server-encrypted': 'false', + 'x-ms-request-id': '31edce17-001c-0002-43ab-ffcffb000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:48 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .get('/archive-cont-testdata2?restype=container&comp=list') + .reply(200, "\narchive-blob-testdata3Tue, 18 Jul 2017 09:51:46 GMT0x8D4CDC29A57B04A0application/octet-stream0PageBlobP4unlockedavailablefalse", { 'transfer-encoding': 'chunked', + 'content-type': 'application/xml', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '525bae98-001c-0013-14ab-fff258000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:49 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .get('/archive-cont-testdata2?restype=container&comp=list') + .reply(200, "\narchive-blob-testdata3Tue, 18 Jul 2017 09:51:46 GMT0x8D4CDC29A57B04A0application/octet-stream0PageBlobP4unlockedavailablefalse", { 'transfer-encoding': 'chunked', + 'content-type': 'application/xml', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '525bae98-001c-0013-14ab-fff258000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:49 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata2/archive-blob-testdata3?comp=tier') + .reply(200, "", { server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'eb2bfce5-001c-000b-17ab-ff4a69000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:50 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata2/archive-blob-testdata3?comp=tier') + .reply(200, "", { server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'eb2bfce5-001c-000b-17ab-ff4a69000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:50 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata2/archive-blob-testdata3') + .reply(200, "", { 'content-length': '0', + 'content-type': 'application/octet-stream', + 'last-modified': 'Tue, 18 Jul 2017 09:51:46 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D4CDC29A57B04A"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-access-tier': 'P6', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-blob-type': 'PageBlob', + 'x-ms-blob-sequence-number': '0', + 'x-ms-server-encrypted': 'false', + 'x-ms-request-id': '4c65013d-001c-0001-31ab-fff87d000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:51 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata2/archive-blob-testdata3') + .reply(200, "", { 'content-length': '0', + 'content-type': 'application/octet-stream', + 'last-modified': 'Tue, 18 Jul 2017 09:51:46 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D4CDC29A57B04A"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-access-tier': 'P6', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-blob-type': 'PageBlob', + 'x-ms-blob-sequence-number': '0', + 'x-ms-server-encrypted': 'false', + 'x-ms-request-id': '4c65013d-001c-0001-31ab-fff87d000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:51 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata2/archive-blob-testdata3?comp=tier') + .reply(409, "\nCannotChangeToLowerTierA higher blob tier has already been explicitly set.\nRequestId:95629edd-001c-0009-2bab-ff9092000000\nTime:2017-07-18T09:51:53.3447055Z", { 'content-length': '244', + 'content-type': 'application/xml', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '95629edd-001c-0009-2bab-ff9092000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:52 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata2/archive-blob-testdata3?comp=tier') + .reply(409, "\nCannotChangeToLowerTierA higher blob tier has already been explicitly set.\nRequestId:95629edd-001c-0009-2bab-ff9092000000\nTime:2017-07-18T09:51:53.3447055Z", { 'content-length': '244', + 'content-type': 'application/xml', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '95629edd-001c-0009-2bab-ff9092000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:52 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata2/archive-blob-testdata3') + .reply(200, "", { 'content-length': '0', + 'content-type': 'application/octet-stream', + 'last-modified': 'Tue, 18 Jul 2017 09:51:46 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D4CDC29A57B04A"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-access-tier': 'P6', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-blob-type': 'PageBlob', + 'x-ms-blob-sequence-number': '0', + 'x-ms-server-encrypted': 'false', + 'x-ms-request-id': '613c6d3b-001c-000f-2bab-fffe9e000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:54 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata2/archive-blob-testdata3') + .reply(200, "", { 'content-length': '0', + 'content-type': 'application/octet-stream', + 'last-modified': 'Tue, 18 Jul 2017 09:51:46 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D4CDC29A57B04A"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-access-tier': 'P6', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-blob-type': 'PageBlob', + 'x-ms-blob-sequence-number': '0', + 'x-ms-server-encrypted': 'false', + 'x-ms-request-id': '613c6d3b-001c-000f-2bab-fffe9e000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:54 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata2?restype=container') + .reply(200, "", { 'last-modified': 'Tue, 18 Jul 2017 09:51:45 GMT', + etag: '"0x8D4CDC299FBC00B"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-request-id': '51b9db93-001c-0008-76ab-ff7def000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:54 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata2?restype=container') + .reply(200, "", { 'last-modified': 'Tue, 18 Jul 2017 09:51:45 GMT', + etag: '"0x8D4CDC299FBC00B"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-request-id': '51b9db93-001c-0008-76ab-ff7def000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:54 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .delete('/archive-cont-testdata2?restype=container') + .reply(202, "", { server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '5f3e545c-001c-000d-69ab-ff2465000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:56 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .delete('/archive-cont-testdata2?restype=container') + .reply(202, "", { server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '5f3e545c-001c-000d-69ab-ff2465000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:56 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }], +[function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata4?restype=container') + .reply(200, "", { 'last-modified': 'Tue, 18 Jul 2017 09:50:49 GMT', + etag: '"0x8D4CDC2789385E2"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-request-id': 'fe9fbb1d-001c-0011-37ab-ff28a3000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:57 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata4?restype=container') + .reply(200, "", { 'last-modified': 'Tue, 18 Jul 2017 09:50:49 GMT', + etag: '"0x8D4CDC2789385E2"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-request-id': 'fe9fbb1d-001c-0011-37ab-ff28a3000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:57 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata4/archive-blob-testdata5') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:51:57 GMT', + etag: '"0x8D4CDC2A13B0DAB"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': '4646bfa2-001c-0004-68ab-ffa1f7000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:57 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata4/archive-blob-testdata5') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:51:57 GMT', + etag: '"0x8D4CDC2A13B0DAB"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': '4646bfa2-001c-0004-68ab-ffa1f7000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:57 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata4/archive-blob-testdata5temp') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:51:59 GMT', + etag: '"0x8D4CDC2A22EABCD"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': 'e6a6c275-001c-0006-50ab-ff7b0c000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:59 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata4/archive-blob-testdata5temp') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:51:59 GMT', + etag: '"0x8D4CDC2A22EABCD"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': 'e6a6c275-001c-0006-50ab-ff7b0c000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:51:59 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata4/archive-blob-testdata5temp') + .reply(200, "", { 'content-length': '0', + 'content-type': 'application/octet-stream', + 'last-modified': 'Tue, 18 Jul 2017 09:51:59 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D4CDC2A22EABCD"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-access-tier': 'P10', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-blob-type': 'PageBlob', + 'x-ms-blob-sequence-number': '0', + 'x-ms-server-encrypted': 'false', + 'x-ms-request-id': '2266a550-001c-0005-5cab-ff4c8a000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:00 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata4/archive-blob-testdata5temp') + .reply(200, "", { 'content-length': '0', + 'content-type': 'application/octet-stream', + 'last-modified': 'Tue, 18 Jul 2017 09:51:59 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D4CDC2A22EABCD"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-access-tier': 'P10', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-blob-type': 'PageBlob', + 'x-ms-blob-sequence-number': '0', + 'x-ms-server-encrypted': 'false', + 'x-ms-request-id': '2266a550-001c-0005-5cab-ff4c8a000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:00 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata4?restype=container') + .reply(200, "", { 'last-modified': 'Tue, 18 Jul 2017 09:50:49 GMT', + etag: '"0x8D4CDC2789385E2"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-request-id': '81ad78fd-001c-0003-37ab-ff2286000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:00 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata4?restype=container') + .reply(200, "", { 'last-modified': 'Tue, 18 Jul 2017 09:50:49 GMT', + etag: '"0x8D4CDC2789385E2"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-request-id': '81ad78fd-001c-0003-37ab-ff2286000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:00 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .delete('/archive-cont-testdata4?restype=container') + .reply(202, "", { server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '31edce27-001c-0002-4cab-ffcffb000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:01 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .delete('/archive-cont-testdata4?restype=container') + .reply(202, "", { server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '31edce27-001c-0002-4cab-ffcffb000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:01 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }], +[function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata6?restype=container') + .reply(404, "", { vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'eb2c010f-001c-000b-40ab-ff4a69000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:03 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata6?restype=container') + .reply(404, "", { vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'eb2c010f-001c-000b-40ab-ff4a69000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:03 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata6?restype=container') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:04 GMT', + etag: '"0x8D4CDC2A52CC0A5"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '4c650140-001c-0001-33ab-fff87d000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:03 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata6?restype=container') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:04 GMT', + etag: '"0x8D4CDC2A52CC0A5"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '4c650140-001c-0001-33ab-fff87d000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:03 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata6/archive-blob-testdata7') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:05 GMT', + etag: '"0x8D4CDC2A59FAA88"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': '57130ec0-001c-000a-6bab-ffa714000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:04 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata6/archive-blob-testdata7') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:05 GMT', + etag: '"0x8D4CDC2A59FAA88"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': '57130ec0-001c-000a-6bab-ffa714000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:04 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata6/archive-blob-testdata7temp') + .reply(409, "\nBlobTierInadequateForContentLengthSpecified blob tier size limit cannot be less than content length.\nRequestId:9562a30a-001c-0009-58ab-ff9092000000\nTime:2017-07-18T09:52:06.5418627Z", { 'content-length': '270', + 'content-type': 'application/xml', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '9562a30a-001c-0009-58ab-ff9092000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:05 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata6/archive-blob-testdata7temp') + .reply(409, "\nBlobTierInadequateForContentLengthSpecified blob tier size limit cannot be less than content length.\nRequestId:9562a30a-001c-0009-58ab-ff9092000000\nTime:2017-07-18T09:52:06.5418627Z", { 'content-length': '270', + 'content-type': 'application/xml', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '9562a30a-001c-0009-58ab-ff9092000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:05 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata6?restype=container') + .reply(200, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:04 GMT', + etag: '"0x8D4CDC2A52CC0A5"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-request-id': '613c6d49-001c-000f-30ab-fffe9e000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:06 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata6?restype=container') + .reply(200, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:04 GMT', + etag: '"0x8D4CDC2A52CC0A5"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-request-id': '613c6d49-001c-000f-30ab-fffe9e000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:06 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .delete('/archive-cont-testdata6?restype=container') + .reply(202, "", { server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '51b9db99-001c-0008-7bab-ff7def000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:08 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .delete('/archive-cont-testdata6?restype=container') + .reply(202, "", { server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '51b9db99-001c-0008-7bab-ff7def000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:08 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }], +[function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata8?restype=container') + .reply(404, "", { vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '12fffbf1-001c-0007-1aab-ff9671000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:09 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata8?restype=container') + .reply(404, "", { vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '12fffbf1-001c-0007-1aab-ff9671000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:09 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata8?restype=container') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:10 GMT', + etag: '"0x8D4CDC2A8BF6500"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '525baea0-001c-0013-1aab-fff258000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:10 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata8?restype=container') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:10 GMT', + etag: '"0x8D4CDC2A8BF6500"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '525baea0-001c-0013-1aab-fff258000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:10 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata8/archive-blob-testdata9') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:11 GMT', + etag: '"0x8D4CDC2A9182534"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': '5f3e5464-001c-000d-6fab-ff2465000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:11 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata8/archive-blob-testdata9') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:11 GMT', + etag: '"0x8D4CDC2A9182534"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': '5f3e5464-001c-000d-6fab-ff2465000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:11 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata8/archive-blob-testdata9temp') + .reply(400, "\nInvalidBlobTierThe specified blob tier is invalid.\nRequestId:fe9fbb23-001c-0011-3cab-ff28a3000000\nTime:2017-07-18T09:52:13.9677627Z", { 'content-length': '220', + 'content-type': 'application/xml', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'fe9fbb23-001c-0011-3cab-ff28a3000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:13 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata8/archive-blob-testdata9temp') + .reply(400, "\nInvalidBlobTierThe specified blob tier is invalid.\nRequestId:fe9fbb23-001c-0011-3cab-ff28a3000000\nTime:2017-07-18T09:52:13.9677627Z", { 'content-length': '220', + 'content-type': 'application/xml', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'fe9fbb23-001c-0011-3cab-ff28a3000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:13 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata8?restype=container') + .reply(200, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:10 GMT', + etag: '"0x8D4CDC2A8BF6500"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-request-id': '2266a97e-001c-0005-09ab-ff4c8a000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:14 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata8?restype=container') + .reply(200, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:10 GMT', + etag: '"0x8D4CDC2A8BF6500"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-request-id': '2266a97e-001c-0005-09ab-ff4c8a000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:14 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .delete('/archive-cont-testdata8?restype=container') + .reply(202, "", { server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '4c650144-001c-0001-36ab-fff87d000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:15 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .delete('/archive-cont-testdata8?restype=container') + .reply(202, "", { server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '4c650144-001c-0001-36ab-fff87d000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:15 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }], +[function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata10?restype=container') + .reply(404, "", { vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '12fffbf3-001c-0007-1cab-ff9671000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:16 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata10?restype=container') + .reply(404, "", { vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '12fffbf3-001c-0007-1cab-ff9671000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:16 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata10?restype=container') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:17 GMT', + etag: '"0x8D4CDC2AD1EFF21"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '4646bfb4-001c-0004-71ab-ffa1f7000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:17 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata10?restype=container') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:17 GMT', + etag: '"0x8D4CDC2AD1EFF21"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '4646bfb4-001c-0004-71ab-ffa1f7000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:17 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata10/archive-blob-testdata11') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:24 GMT', + etag: '"0x8D4CDC2B0FDA352"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': 'e6a6c27b-001c-0006-54ab-ff7b0c000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:24 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata10/archive-blob-testdata11') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:24 GMT', + etag: '"0x8D4CDC2B0FDA352"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': 'e6a6c27b-001c-0006-54ab-ff7b0c000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:24 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata10/archive-blob-testdata11') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:25 GMT', + etag: '"0x8D4CDC2B194B23B"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': '31edce35-001c-0002-59ab-ffcffb000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:25 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata10/archive-blob-testdata11') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:25 GMT', + etag: '"0x8D4CDC2B194B23B"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': '31edce35-001c-0002-59ab-ffcffb000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:25 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .filteringRequestBody(function (path) { return '*';}) +.put('/archive-cont-testdata10/archive-blob-testdata11?comp=page', '*') + .reply(201, "", { 'content-md5': 'VJXsRKPJgaTKv8EXnmtrQg==', + 'last-modified': 'Tue, 18 Jul 2017 09:52:28 GMT', + etag: '"0x8D4CDC2B3B13CC7"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-blob-sequence-number': '0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': '525baea4-001c-0013-1eab-fff258000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:28 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .filteringRequestBody(function (path) { return '*';}) +.put('/archive-cont-testdata10/archive-blob-testdata11?comp=page', '*') + .reply(201, "", { 'content-md5': 'VJXsRKPJgaTKv8EXnmtrQg==', + 'last-modified': 'Tue, 18 Jul 2017 09:52:28 GMT', + etag: '"0x8D4CDC2B3B13CC7"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-blob-sequence-number': '0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': '525baea4-001c-0013-1eab-fff258000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:28 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata10/archive-blob-testdata11?comp=properties') + .reply(200, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:29 GMT', + etag: '"0x8D4CDC2B457B8E6"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-blob-sequence-number': '0', + 'x-ms-request-id': '9562ab63-001c-0009-2eab-ff9092000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:29 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata10/archive-blob-testdata11?comp=properties') + .reply(200, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:29 GMT', + etag: '"0x8D4CDC2B457B8E6"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-blob-sequence-number': '0', + 'x-ms-request-id': '9562ab63-001c-0009-2eab-ff9092000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:29 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata10/archive-blob-testdata11') + .reply(200, "", { 'content-length': '4194304', + 'content-type': 'application/octet-stream', + 'last-modified': 'Tue, 18 Jul 2017 09:52:29 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D4CDC2B457B8E6"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-access-tier': 'P10', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-blob-type': 'PageBlob', + 'x-ms-blob-sequence-number': '0', + 'x-ms-server-encrypted': 'false', + 'x-ms-request-id': '613c6d54-001c-000f-39ab-fffe9e000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:30 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata10/archive-blob-testdata11') + .reply(200, "", { 'content-length': '4194304', + 'content-type': 'application/octet-stream', + 'last-modified': 'Tue, 18 Jul 2017 09:52:29 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D4CDC2B457B8E6"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-access-tier': 'P10', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-blob-type': 'PageBlob', + 'x-ms-blob-sequence-number': '0', + 'x-ms-server-encrypted': 'false', + 'x-ms-request-id': '613c6d54-001c-000f-39ab-fffe9e000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:30 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata10?restype=container') + .reply(200, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:17 GMT', + etag: '"0x8D4CDC2AD1EFF21"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-request-id': '51b9dba7-001c-0008-02ab-ff7def000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:31 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata10?restype=container') + .reply(200, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:17 GMT', + etag: '"0x8D4CDC2AD1EFF21"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-request-id': '51b9dba7-001c-0008-02ab-ff7def000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:31 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .delete('/archive-cont-testdata10?restype=container') + .reply(202, "", { server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '12fffbfd-001c-0007-1fab-ff9671000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:32 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .delete('/archive-cont-testdata10?restype=container') + .reply(202, "", { server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '12fffbfd-001c-0007-1fab-ff9671000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:32 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }], +[function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata12?restype=container') + .reply(404, "", { vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '54f6516e-001c-000e-4eab-ff13e3000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:34 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata12?restype=container') + .reply(404, "", { vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '54f6516e-001c-000e-4eab-ff13e3000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:34 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata12?restype=container') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:35 GMT', + etag: '"0x8D4CDC2B7663A4D"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'fe9fbb2a-001c-0011-42ab-ff28a3000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:35 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata12?restype=container') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:35 GMT', + etag: '"0x8D4CDC2B7663A4D"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'fe9fbb2a-001c-0011-42ab-ff28a3000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:35 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata12/archive-blob-testdata13') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:35 GMT', + etag: '"0x8D4CDC2B7CCB03D"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': 'b511f794-001c-000c-7eab-ffc918000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:35 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata12/archive-blob-testdata13') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:35 GMT', + etag: '"0x8D4CDC2B7CCB03D"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': 'b511f794-001c-000c-7eab-ffc918000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:35 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata12/archive-blob-testdata13') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:36 GMT', + etag: '"0x8D4CDC2B85F513E"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': '4646bfbb-001c-0004-77ab-ffa1f7000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:36 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata12/archive-blob-testdata13') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:36 GMT', + etag: '"0x8D4CDC2B85F513E"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': '4646bfbb-001c-0004-77ab-ffa1f7000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:36 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .filteringRequestBody(function (path) { return '*';}) +.put('/archive-cont-testdata12/archive-blob-testdata13?comp=page', '*') + .reply(201, "", { 'content-md5': 'VJXsRKPJgaTKv8EXnmtrQg==', + 'last-modified': 'Tue, 18 Jul 2017 09:52:40 GMT', + etag: '"0x8D4CDC2BA9BA0CA"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-blob-sequence-number': '0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': 'e6a6c288-001c-0006-5aab-ff7b0c000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:40 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .filteringRequestBody(function (path) { return '*';}) +.put('/archive-cont-testdata12/archive-blob-testdata13?comp=page', '*') + .reply(201, "", { 'content-md5': 'VJXsRKPJgaTKv8EXnmtrQg==', + 'last-modified': 'Tue, 18 Jul 2017 09:52:40 GMT', + etag: '"0x8D4CDC2BA9BA0CA"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-blob-sequence-number': '0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': 'e6a6c288-001c-0006-5aab-ff7b0c000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:40 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata12/archive-blob-testdata13?comp=properties') + .reply(200, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:41 GMT', + etag: '"0x8D4CDC2BB689A5E"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-blob-sequence-number': '0', + 'x-ms-request-id': '5f3e546e-001c-000d-78ab-ff2465000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:42 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata12/archive-blob-testdata13?comp=properties') + .reply(200, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:41 GMT', + etag: '"0x8D4CDC2BB689A5E"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-blob-sequence-number': '0', + 'x-ms-request-id': '5f3e546e-001c-000d-78ab-ff2465000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:42 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata12/archive-blob-testdata13') + .reply(200, "", { 'content-length': '4194304', + 'last-modified': 'Tue, 18 Jul 2017 09:52:41 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D4CDC2BB689A5E"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-access-tier': 'P20', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-blob-type': 'PageBlob', + 'x-ms-blob-sequence-number': '0', + 'x-ms-server-encrypted': 'false', + 'x-ms-request-id': 'b511f797-001c-000c-01ab-ffc918000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:43 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata12/archive-blob-testdata13') + .reply(200, "", { 'content-length': '4194304', + 'last-modified': 'Tue, 18 Jul 2017 09:52:41 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D4CDC2BB689A5E"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-access-tier': 'P20', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-blob-type': 'PageBlob', + 'x-ms-blob-sequence-number': '0', + 'x-ms-server-encrypted': 'false', + 'x-ms-request-id': 'b511f797-001c-000c-01ab-ffc918000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:43 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata12?restype=container') + .reply(200, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:35 GMT', + etag: '"0x8D4CDC2B7663A4D"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-request-id': '2266b88e-001c-0005-12ab-ff4c8a000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:44 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata12?restype=container') + .reply(200, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:35 GMT', + etag: '"0x8D4CDC2B7663A4D"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-request-id': '2266b88e-001c-0005-12ab-ff4c8a000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:44 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .delete('/archive-cont-testdata12?restype=container') + .reply(202, "", { server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '9193647b-001c-0014-7eab-ff7129000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:44 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .delete('/archive-cont-testdata12?restype=container') + .reply(202, "", { server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '9193647b-001c-0014-7eab-ff7129000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:44 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }], +[function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata14?restype=container') + .reply(404, "", { vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '31edce43-001c-0002-66ab-ffcffb000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:45 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata14?restype=container') + .reply(404, "", { vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '31edce43-001c-0002-66ab-ffcffb000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:45 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata14?restype=container') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:47 GMT', + etag: '"0x8D4CDC2BE92D8A7"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '525baeb1-001c-0013-23ab-fff258000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:47 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata14?restype=container') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:47 GMT', + etag: '"0x8D4CDC2BE92D8A7"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '525baeb1-001c-0013-23ab-fff258000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:47 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata14/archive-blob-testdata15') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:57 GMT', + etag: '"0x8D4CDC2C4E54BD4"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': 'eb2c107f-001c-000b-28ab-ff4a69000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:57 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata14/archive-blob-testdata15') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:57 GMT', + etag: '"0x8D4CDC2C4E54BD4"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': 'eb2c107f-001c-000b-28ab-ff4a69000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:57 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata14/archive-blob-testdata15') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:58 GMT', + etag: '"0x8D4CDC2C5816514"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': '51b9dbb1-001c-0008-0aab-ff7def000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:58 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata14/archive-blob-testdata15') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:58 GMT', + etag: '"0x8D4CDC2C5816514"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': '51b9dbb1-001c-0008-0aab-ff7def000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:52:58 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .filteringRequestBody(function (path) { return '*';}) +.put('/archive-cont-testdata14/archive-blob-testdata15?comp=page', '*') + .reply(201, "", { 'content-md5': 'VJXsRKPJgaTKv8EXnmtrQg==', + 'last-modified': 'Tue, 18 Jul 2017 09:53:02 GMT', + etag: '"0x8D4CDC2C7A01306"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-blob-sequence-number': '0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': '12fffc04-001c-0007-23ab-ff9671000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:53:02 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .filteringRequestBody(function (path) { return '*';}) +.put('/archive-cont-testdata14/archive-blob-testdata15?comp=page', '*') + .reply(201, "", { 'content-md5': 'VJXsRKPJgaTKv8EXnmtrQg==', + 'last-modified': 'Tue, 18 Jul 2017 09:53:02 GMT', + etag: '"0x8D4CDC2C7A01306"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-blob-sequence-number': '0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': '12fffc04-001c-0007-23ab-ff9671000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:53:02 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata14/archive-blob-testdata15?comp=properties') + .reply(200, "", { 'last-modified': 'Tue, 18 Jul 2017 09:53:03 GMT', + etag: '"0x8D4CDC2C83F6168"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-blob-sequence-number': '0', + 'x-ms-request-id': '54f65185-001c-000e-5eab-ff13e3000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:53:02 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata14/archive-blob-testdata15?comp=properties') + .reply(200, "", { 'last-modified': 'Tue, 18 Jul 2017 09:53:03 GMT', + etag: '"0x8D4CDC2C83F6168"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-blob-sequence-number': '0', + 'x-ms-request-id': '54f65185-001c-000e-5eab-ff13e3000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:53:02 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata14/archive-blob-testdata15') + .reply(200, "", { 'content-length': '4194304', + 'last-modified': 'Tue, 18 Jul 2017 09:53:03 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D4CDC2C83F6168"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-access-tier': 'P30', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-blob-type': 'PageBlob', + 'x-ms-blob-sequence-number': '0', + 'x-ms-server-encrypted': 'false', + 'x-ms-request-id': '5f3e5482-001c-000d-04ab-ff2465000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:53:03 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata14/archive-blob-testdata15') + .reply(200, "", { 'content-length': '4194304', + 'last-modified': 'Tue, 18 Jul 2017 09:53:03 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D4CDC2C83F6168"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-access-tier': 'P30', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-blob-type': 'PageBlob', + 'x-ms-blob-sequence-number': '0', + 'x-ms-server-encrypted': 'false', + 'x-ms-request-id': '5f3e5482-001c-000d-04ab-ff2465000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:53:03 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata14?restype=container') + .reply(200, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:47 GMT', + etag: '"0x8D4CDC2BE92D8A7"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-request-id': 'd013167b-001c-0000-16ab-ff1500000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:53:05 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata14?restype=container') + .reply(200, "", { 'last-modified': 'Tue, 18 Jul 2017 09:52:47 GMT', + etag: '"0x8D4CDC2BE92D8A7"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-request-id': 'd013167b-001c-0000-16ab-ff1500000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:53:05 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .delete('/archive-cont-testdata14?restype=container') + .reply(202, "", { server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'fe9fbb36-001c-0011-4bab-ff28a3000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:53:06 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .delete('/archive-cont-testdata14?restype=container') + .reply(202, "", { server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'fe9fbb36-001c-0011-4bab-ff28a3000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:53:06 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }], +[function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata16?restype=container') + .reply(404, "", { vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'e6a6c290-001c-0006-61ab-ff7b0c000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:53:07 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata16?restype=container') + .reply(404, "", { vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'e6a6c290-001c-0006-61ab-ff7b0c000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:53:07 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata16?restype=container') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:53:09 GMT', + etag: '"0x8D4CDC2CC228C04"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '2266c75c-001c-0005-5dab-ff4c8a000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:53:09 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata16?restype=container') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:53:09 GMT', + etag: '"0x8D4CDC2CC228C04"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '2266c75c-001c-0005-5dab-ff4c8a000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:53:09 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata16/archive-blob-testdata17') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:53:10 GMT', + etag: '"0x8D4CDC2CC7E1D36"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': '91936c6c-001c-0014-6dab-ff7129000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:53:10 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata16/archive-blob-testdata17') + .reply(201, "", { 'last-modified': 'Tue, 18 Jul 2017 09:53:10 GMT', + etag: '"0x8D4CDC2CC7E1D36"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted': 'false', + 'x-ms-request-id': '91936c6c-001c-0014-6dab-ff7129000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:53:10 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata16/archive-blob-testdata17copied') + .reply(202, "", { 'last-modified': 'Tue, 18 Jul 2017 09:53:11 GMT', + etag: '"0x8D4CDC2CD1616BE"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-copy-status': 'success', + 'x-ms-copy-id': '39822ae4-8252-4239-a720-e7c927e9806d', + 'x-ms-request-id': '81ad8689-001c-0003-38ab-ff2286000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:53:11 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .put('/archive-cont-testdata16/archive-blob-testdata17copied') + .reply(202, "", { 'last-modified': 'Tue, 18 Jul 2017 09:53:11 GMT', + etag: '"0x8D4CDC2CD1616BE"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-copy-status': 'success', + 'x-ms-copy-id': '39822ae4-8252-4239-a720-e7c927e9806d', + 'x-ms-request-id': '81ad8689-001c-0003-38ab-ff2286000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:53:11 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata16/archive-blob-testdata17copied') + .reply(200, "", { 'content-length': '0', + 'content-type': 'application/octet-stream', + 'last-modified': 'Tue, 18 Jul 2017 09:53:11 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D4CDC2CD1616BE"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-copy-id': '39822ae4-8252-4239-a720-e7c927e9806d', + 'x-ms-copy-progress': '0/0', + 'x-ms-copy-source': 'https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net/archive-cont-testdata16/archive-blob-testdata17', + 'x-ms-copy-status': 'success', + 'x-ms-copy-completion-time': 'Tue, 18 Jul 2017 09:53:11 GMT', + 'x-ms-access-tier': 'P20', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-blob-type': 'PageBlob', + 'x-ms-blob-sequence-number': '0', + 'x-ms-server-encrypted': 'false', + 'x-ms-request-id': '57131309-001c-000a-28ab-ffa714000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:53:14 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata16/archive-blob-testdata17copied') + .reply(200, "", { 'content-length': '0', + 'content-type': 'application/octet-stream', + 'last-modified': 'Tue, 18 Jul 2017 09:53:11 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D4CDC2CD1616BE"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-copy-id': '39822ae4-8252-4239-a720-e7c927e9806d', + 'x-ms-copy-progress': '0/0', + 'x-ms-copy-source': 'https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net/archive-cont-testdata16/archive-blob-testdata17', + 'x-ms-copy-status': 'success', + 'x-ms-copy-completion-time': 'Tue, 18 Jul 2017 09:53:11 GMT', + 'x-ms-access-tier': 'P20', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-blob-type': 'PageBlob', + 'x-ms-blob-sequence-number': '0', + 'x-ms-server-encrypted': 'false', + 'x-ms-request-id': '57131309-001c-000a-28ab-ffa714000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:53:14 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata16?restype=container') + .reply(200, "", { 'last-modified': 'Tue, 18 Jul 2017 09:53:09 GMT', + etag: '"0x8D4CDC2CC228C04"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-request-id': '613c6d61-001c-000f-44ab-fffe9e000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:53:16 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .head('/archive-cont-testdata16?restype=container') + .reply(200, "", { 'last-modified': 'Tue, 18 Jul 2017 09:53:09 GMT', + etag: '"0x8D4CDC2CC228C04"', + vary: 'Origin', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-lease-state': 'available', + 'x-ms-lease-status': 'unlocked', + 'x-ms-request-id': '613c6d61-001c-000f-44ab-fffe9e000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:53:16 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .delete('/archive-cont-testdata16?restype=container') + .reply(202, "", { server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '51b9dbbb-001c-0008-13ab-ff7def000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:53:17 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }, +function (nock) { +var result = +nock('https://xiaonliprepp.blob.rr1xio.xstore-test.windows-int.net:443') + .delete('/archive-cont-testdata16?restype=container') + .reply(202, "", { server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '51b9dbbb-001c-0008-13ab-ff7def000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 18 Jul 2017 09:53:17 GMT', + connection: 'close', + 'content-length': '0' }); + return result; }]]; \ No newline at end of file diff --git a/test/services/blob/blobservice-archive-tests.js b/test/services/blob/blobservice-archive-tests.js new file mode 100644 index 00000000..5da697e9 --- /dev/null +++ b/test/services/blob/blobservice-archive-tests.js @@ -0,0 +1,243 @@ +// +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +var assert = require('assert'); +var fs = require('fs'); + +// Lib includes +var testutil = require('../../framework/util'); +var azure = testutil.libRequire('azure-storage'); +var azureutil = testutil.libRequire('/common/util/util'); +var blobutil = azure.BlobUtilities; +var TestSuite = require('../../framework/test-suite'); + +var containerNamesPrefix = 'archive-cont-'; +var blobNamesPrefix = 'archive-blob-'; +var rehydrate2hot = 'rehydrate-pending-to-hot'; +var rehydrate2cool = 'rehydrate-pending-to-cool'; + +var blobAccountLRSConnectionString = process.env.AZURE_STORAGE_CONNECTION_STRING_BLOB_ACCOUNT_LRS; +var premiumAccountConnectionString = process.env.AZURE_STORAGE_CONNECTION_STRING_PREMIUM_ACCOUNT; +var blobAccountLRSConnectionStringEnabled = !azureutil.IsNullOrEmptyOrUndefinedOrWhiteSpace(blobAccountLRSConnectionString); +var premiumAccountConnectionStringEnabled = !azureutil.IsNullOrEmptyOrUndefinedOrWhiteSpace(premiumAccountConnectionString); + +var blockBlobSuite = new TestSuite('blob-archive-blockblob-tests'); +var pageBlobSuite = new TestSuite('blob-archive-pageblob-tests'); + +var runBlockBlobSuite = blobAccountLRSConnectionStringEnabled || (!blobAccountLRSConnectionStringEnabled && blockBlobSuite.isPlayback()); +var runPageBlobSuite = premiumAccountConnectionStringEnabled || (!premiumAccountConnectionStringEnabled && pageBlobSuite.isPlayback()); +var runBlockBlobCase = runBlockBlobSuite ? it : it.skip; +var runPageBlobCase = runPageBlobSuite ? it : it.skip; + +var blobService; +var containerName; +var blobName; + +describe('BlobArchive', function () { + describe('Archive tests for page blobs in a premium storage account', function () { + before(function (done) { + if (!runPageBlobSuite) { + done(); + } else { + if (pageBlobSuite.isMocked) { + pageBlobSuite.POLL_REQUEST_INTERVAL = 0; + } + + pageBlobSuite.setupSuite(function () { + premiumAccountConnectionString = process.env.AZURE_STORAGE_CONNECTION_STRING_PREMIUM_ACCOUNT; + blobService = azure.createBlobService(premiumAccountConnectionString).withFilter(new azure.ExponentialRetryPolicyFilter()); + done(); + }); + } + }); + + after(function (done) { + if (!runPageBlobSuite) { + done(); + } else { + pageBlobSuite.teardownSuite(done); + } + }); + + beforeEach(function (done) { + if (!runPageBlobSuite) { + done(); + } else { + pageBlobSuite.setupTest(function () { + containerName = pageBlobSuite.getName(containerNamesPrefix).toLowerCase(); + blobService.createContainerIfNotExists(containerName, function (createError, container) { + assert.equal(createError, null); + assert.notEqual(container, null); + + blobName = pageBlobSuite.getName(blobNamesPrefix).toLowerCase(); + blobService.createPageBlob(containerName, blobName, 0, function (uploadError, uploadResponse) { + assert.equal(uploadError, null); + assert.ok(uploadResponse.isSuccessful); + done(); + }); + }); + }); + } + }); + + afterEach(function (done) { + if (!runPageBlobSuite) { + done(); + } else { + blobService.deleteContainerIfExists(containerName, function (err, exist, res) { + assert.equal(err, null); + pageBlobSuite.teardownTest(done); + }); + } + }); + + runPageBlobCase('Shoud return inferred tier property', function (done) { + blobService.getBlobProperties(containerName, blobName, function (err, properties, resp) { + assert.equal(err, null); + assert.equal(properties.accessTierInferred, true); + done(); + }); + }); + + runPageBlobCase('setBlobTier should work setting higher tier for a page blob but not for lower tier', function (done) { + blobService.setBlobTier(containerName, blobName, blobutil.BlobTier.PremiumPageBlobTier.P4, function (err, resp) { + assert.equal(err, null); + + blobService.getBlobProperties(containerName, blobName, function (err, properties, resp) { + assert.equal(err, null); + assert.equal(properties.accessTier, blobutil.BlobTier.PremiumPageBlobTier.P4); + + blobService.listBlobsSegmented(containerName, null, function (err, results, resp) { + assert.equal(err, null); + assert.equal(results.entries.length, 1); + assert.equal(results.entries[0].accessTier, blobutil.BlobTier.PremiumPageBlobTier.P4); + + blobService.setBlobTier(containerName, blobName, blobutil.BlobTier.PremiumPageBlobTier.P6, function (err, resp) { + assert.equal(err, null); + + blobService.getBlobProperties(containerName, blobName, function (err, properties, resp) { + assert.equal(true, (properties.accessTier === blobutil.BlobTier.PremiumPageBlobTier.P6)); + + blobService.setBlobTier(containerName, blobName, blobutil.BlobTier.PremiumPageBlobTier.P4, function (err, resp) { + assert.notEqual(err, null); + + blobService.getBlobProperties(containerName, blobName, function (err, properties, resp) { + assert.equal(properties.accessTier, blobutil.BlobTier.PremiumPageBlobTier.P6); + done(); + }); + }); + }); + }); + }); + }); + }); + }); + + runPageBlobCase('createPageBlob should work with setting page blob tier', function (done) { + blobName += 'temp'; + blobService.createPageBlob(containerName, blobName, 0, { blobTier: blobutil.BlobTier.PremiumPageBlobTier.P10 }, function (uploadError, uploadResponse) { + assert.equal(uploadError, null); + assert.ok(uploadResponse.isSuccessful); + + blobService.getBlobProperties(containerName, blobName, function (err, properties, resp) { + assert.equal(true, (properties.accessTier === blobutil.BlobTier.PremiumPageBlobTier.P10)); + done(); + }); + }); + }); + + runPageBlobCase('createPageBlob should not work with setting small tier for large size blob', function (done) { + blobName += 'temp'; + blobService.createPageBlob(containerName, blobName, 1024 * 1024 * 1024 * 512, { blobTier: blobutil.BlobTier.PremiumPageBlobTier.P4 }, function (uploadError, uploadResponse) { + assert.notEqual(uploadError, null); + done(); + }); + }); + + runPageBlobCase('createPageBlob should not work with setting block blob tier for page blob', function (done) { + blobName += 'temp'; + blobService.createPageBlob(containerName, blobName, 0, { blobTier: 'HOT' }, function (uploadError, uploadResponse) { + assert.notEqual(uploadError, null); + done(); + }); + }); + + runPageBlobCase('createPageBlobFromLocalFile should work with setting page blob tier', function (done) { + var localFileName = blobName + '.tmp'; + fs.writeFileSync(localFileName, Buffer.alloc(1024 * 1024 * 4, 'e')); + + blobService.createPageBlobFromLocalFile(containerName, blobName, localFileName, { blobTier: blobutil.BlobTier.PremiumPageBlobTier.P10 }, function (uploadError, result, uploadResponse) { + assert.equal(uploadError, null); + assert.ok(uploadResponse.isSuccessful); + + blobService.getBlobProperties(containerName, blobName, function (err, properties, resp) { + assert.equal(true, (properties.accessTier === blobutil.BlobTier.PremiumPageBlobTier.P10)); + fs.unlinkSync(localFileName); + done(); + }); + }); + }); + + runPageBlobCase('createPageBlobFromStream should work with setting page blob tier', function (done) { + var localFileName = blobName + '.tmp'; + fs.writeFileSync(localFileName, Buffer.alloc(1024 * 1024 * 4, 'e')); + var readStream = fs.createReadStream(localFileName); + + blobService.createPageBlobFromStream(containerName, blobName, readStream, 1024 * 1024 * 4, { blobTier: blobutil.BlobTier.PremiumPageBlobTier.P20 }, function (uploadError, result, uploadResponse) { + assert.equal(uploadError, null); + assert.ok(uploadResponse.isSuccessful); + + blobService.getBlobProperties(containerName, blobName, function (err, properties, resp) { + assert.equal(true, (properties.accessTier === blobutil.BlobTier.PremiumPageBlobTier.P20)); + fs.unlinkSync(localFileName); + done(); + }); + }); + }); + + runPageBlobCase('createWriteStreamToNewPageBlob should work with setting page blob tier', function (done) { + var localFileName = blobName + '.tmp'; + fs.writeFileSync(localFileName, Buffer.alloc(1024 * 1024 * 4, 'e')); + var readStream = fs.createReadStream(localFileName); + + var writeStream = blobService.createWriteStreamToNewPageBlob(containerName, blobName, 1024 * 1024 * 4, { blobTier: blobutil.BlobTier.PremiumPageBlobTier.P30 }, function (uploadError, result, uploadResponse) { + assert.equal(uploadError, null); + assert.ok(uploadResponse.isSuccessful); + + blobService.getBlobProperties(containerName, blobName, function (err, properties, resp) { + assert.equal(true, (properties.accessTier === blobutil.BlobTier.PremiumPageBlobTier.P30)); + fs.unlinkSync(localFileName); + done(); + }); + }); + + readStream.pipe(writeStream); + }); + + runPageBlobCase('copyBlob should work with setting tier for page blob', function (done) { + var copiedBlobName = blobName + 'copied'; + var sourceBlobUri = blobService.getUrl(containerName, blobName); + + blobService.startCopyBlob(sourceBlobUri, containerName, copiedBlobName, { blobTier: blobutil.BlobTier.PremiumPageBlobTier.P20 }, function (err, result, response) { + setTimeout(function () { + blobService.getBlobProperties(containerName, copiedBlobName, function (err, properties, resp) { + assert.equal(true, (properties.accessTier === blobutil.BlobTier.PremiumPageBlobTier.P20)); + done(); + }); + }, 3000); + }); + }); + }); // inner describe ends +}); // outer describe ends \ No newline at end of file diff --git a/test/services/blob/blobservice-tests.js b/test/services/blob/blobservice-tests.js index 22bbc3c1..ed85893a 100644 --- a/test/services/blob/blobservice-tests.js +++ b/test/services/blob/blobservice-tests.js @@ -1286,7 +1286,7 @@ describe('BlobService', function () { assert.strictEqual(parsedUrl.port, '80'); assert.strictEqual(parsedUrl.hostname, 'host.com'); assert.strictEqual(parsedUrl.pathname, '/' + containerName + '/' + blobName); - assert.strictEqual(parsedUrl.query, 'se=2011-10-12T11%3A53%3A40Z&spr=https&sv=2016-05-31&sr=b&sig=5ubgzWFxfpW857DpF5QVK9HNbewzuQHjvwB%2BlGEdubM%3D'); + assert.strictEqual(parsedUrl.query, 'se=2011-10-12T11%3A53%3A40Z&spr=https&sv=2017-04-17&sr=b&sig=A7y9u890HRxG0XSEsRntrGJ7WIzwrXC5ttro2KFOySU%3D'); blobUrl = blobServiceassert.getUrl(containerName, blobName, sasToken, false, '2016-10-11T11:03:40Z'); @@ -1295,7 +1295,7 @@ describe('BlobService', function () { assert.strictEqual(parsedUrl.port, '80'); assert.strictEqual(parsedUrl.hostname, 'host-secondary.com'); assert.strictEqual(parsedUrl.pathname, '/' + containerName + '/' + blobName); - assert.strictEqual(parsedUrl.query, 'se=2011-10-12T11%3A53%3A40Z&spr=https&sv=2016-05-31&sr=b&sig=5ubgzWFxfpW857DpF5QVK9HNbewzuQHjvwB%2BlGEdubM%3D&snapshot=2016-10-11T11%3A03%3A40Z'); + assert.strictEqual(parsedUrl.query, 'se=2011-10-12T11%3A53%3A40Z&spr=https&sv=2017-04-17&sr=b&sig=A7y9u890HRxG0XSEsRntrGJ7WIzwrXC5ttro2KFOySU%3D&snapshot=2016-10-11T11%3A03%3A40Z'); done(); }); @@ -1376,7 +1376,7 @@ describe('BlobService', function () { assert.equal(sasQueryString[QueryStringConstants.SIGNED_PERMISSIONS], BlobUtilities.SharedAccessPermissions.READ); assert.equal(sasQueryString[QueryStringConstants.SIGNED_PROTOCOL], 'https'); assert.equal(sasQueryString[QueryStringConstants.SIGNED_VERSION], HeaderConstants.TARGET_STORAGE_VERSION); - assert.equal(sasQueryString[QueryStringConstants.SIGNATURE], 'JM+OTBtD7HFVD3A/I5r/iE0HlW8yLcv7DMQoqDT/rtw='); + assert.equal(sasQueryString[QueryStringConstants.SIGNATURE], 'Qa15RHcYQIkyLGqQgvf5qbHesBnK5Uzjgzzpo92vCXc='); done(); }); diff --git a/test/services/file/fileservice-file-tests.js b/test/services/file/fileservice-file-tests.js index 3e227cdf..202f85d7 100644 --- a/test/services/file/fileservice-file-tests.js +++ b/test/services/file/fileservice-file-tests.js @@ -148,7 +148,7 @@ describe('File', function () { var sasToken = fileServiceForUrl.generateSharedAccessSignature(share, directory, file, sharedAccessPolicy); fileServiceForUrl.setHost({ secondaryHost: 'https://host-secondary.com:88/account' }); url = fileServiceForUrl.getUrl(share, directory, file, sasToken, false); - assert.strictEqual(url, 'https://host-secondary.com:88/account/' + share + '/' + directory + '/' + file + '?se=2011-10-12T11%3A53%3A40Z&sp=r&spr=https&sv=2016-05-31&sr=f&sig=s9RdvabzNxKkFGvab6Q5yXsKXgU3vbw%2BTAruKM9qo8o%3D'); + assert.strictEqual(url, 'https://host-secondary.com:88/account/' + share + '/' + directory + '/' + file + '?se=2011-10-12T11%3A53%3A40Z&sp=r&spr=https&sv=2017-04-17&sr=f&sig=iknD7nq7vHhZDMo0DIhwSP0tfYbzvL5cqXlzDktAkLU%3D'); done(); }); diff --git a/test/services/file/fileservice-share-tests.js b/test/services/file/fileservice-share-tests.js index 5198125c..5b9e2aeb 100644 --- a/test/services/file/fileservice-share-tests.js +++ b/test/services/file/fileservice-share-tests.js @@ -575,7 +575,7 @@ describe('FileShare', function () { assert.strictEqual(parsedUrl.port, '80'); assert.strictEqual(parsedUrl.hostname, 'host.com'); assert.strictEqual(parsedUrl.pathname, '/' + share + '/' + directoryName + '/' + fileName); - assert.strictEqual(parsedUrl.query, 'se=2015-02-12T11%3A03%3A40Z&sv=2016-05-31&sr=f&sig=vdfuHApnUUqFEnxBNVpYQWttVq0vg1tKOFI0FjEpTLU%3D'); + assert.strictEqual(parsedUrl.query, 'se=2015-02-12T11%3A03%3A40Z&sv=2017-04-17&sr=f&sig=JxZfLtkbqcu4MK5Xv5Hgn3WRjbCLdR%2BwYh2d0Uma%2BLM%3D'); done(); }); diff --git a/test/services/queue/queueservice-tests.js b/test/services/queue/queueservice-tests.js index 44733fdc..b8679281 100644 --- a/test/services/queue/queueservice-tests.js +++ b/test/services/queue/queueservice-tests.js @@ -1135,7 +1135,7 @@ describe('QueueServiceTests', function() { assert.strictEqual(parsedUrl.port, '80'); assert.strictEqual(parsedUrl.hostname, 'host.com'); assert.strictEqual(parsedUrl.pathname, '/' + queueName); - assert.strictEqual(parsedUrl.query, 'se=2016-10-12T11%3A53%3A40Z&sp=r&spr=https&sv=2016-05-31&sig=c2iGx7iv8NBhNz%2FjPukzNI8xFarrORgEdHyLnzeOTdY%3D'); + assert.strictEqual(parsedUrl.query, 'se=2016-10-12T11%3A53%3A40Z&sp=r&spr=https&sv=2017-04-17&sig=fshivnGCHwnhSmpmw3p4ajE5WuFxrThat1D2yGw6HD0%3D'); done(); }); @@ -1159,7 +1159,7 @@ describe('QueueServiceTests', function() { assert.strictEqual(parsedUrl.port, '80'); assert.strictEqual(parsedUrl.hostname, 'host.com'); assert.strictEqual(parsedUrl.pathname, '/account1/' + queueName); - assert.strictEqual(parsedUrl.query, 'se=2016-10-12T11%3A53%3A40Z&sp=r&spr=https&sv=2016-05-31&sig=c2iGx7iv8NBhNz%2FjPukzNI8xFarrORgEdHyLnzeOTdY%3D'); + assert.strictEqual(parsedUrl.query, 'se=2016-10-12T11%3A53%3A40Z&sp=r&spr=https&sv=2017-04-17&sig=fshivnGCHwnhSmpmw3p4ajE5WuFxrThat1D2yGw6HD0%3D'); done(); }); }); diff --git a/test/services/table/tableservice-tests.js b/test/services/table/tableservice-tests.js index 7b609867..8db9c25e 100644 --- a/test/services/table/tableservice-tests.js +++ b/test/services/table/tableservice-tests.js @@ -1056,7 +1056,7 @@ describe('tableservice-tests', function () { assert.strictEqual(parsedUrl.port, '80'); assert.strictEqual(parsedUrl.hostname, 'host.com'); assert.strictEqual(parsedUrl.pathname, '/' + tableName); - assert.strictEqual(parsedUrl.query, 'se=2016-10-12T11%3A53%3A40Z&sp=r&spr=https&sv=2016-05-31&tn=table1&sig=n12mQK06HfkEsSI%2Fl%2F1mZ1jSv2QSfMxC6Y0mnE00Hq8%3D'); + assert.strictEqual(parsedUrl.query, 'se=2016-10-12T11%3A53%3A40Z&sp=r&spr=https&sv=2017-04-17&tn=table1&sig=XXAimHtxKBj5plT7xVHyQvUfpjD%2BXIHlcrlus8tcGME%3D'); done(); }); @@ -1080,7 +1080,7 @@ describe('tableservice-tests', function () { assert.strictEqual(parsedUrl.port, '80'); assert.strictEqual(parsedUrl.hostname, 'host.com'); assert.strictEqual(parsedUrl.pathname, '/account1/' + tableName); - assert.strictEqual(parsedUrl.query, 'se=2016-10-12T11%3A53%3A40Z&sp=r&spr=https&sv=2016-05-31&tn=table1&sig=n12mQK06HfkEsSI%2Fl%2F1mZ1jSv2QSfMxC6Y0mnE00Hq8%3D'); + assert.strictEqual(parsedUrl.query, 'se=2016-10-12T11%3A53%3A40Z&sp=r&spr=https&sv=2017-04-17&tn=table1&sig=XXAimHtxKBj5plT7xVHyQvUfpjD%2BXIHlcrlus8tcGME%3D'); done(); }); }); diff --git a/typings/azure-storage/azure-storage.d.ts b/typings/azure-storage/azure-storage.d.ts index 8eb93e4e..09dbbeaa 100644 --- a/typings/azure-storage/azure-storage.d.ts +++ b/typings/azure-storage/azure-storage.d.ts @@ -183,7 +183,31 @@ declare module azurestorage { */ setServiceProperties(serviceProperties: common.models.ServicePropertiesResult.ServiceProperties, options: common.RequestOptions, callback: ErrorOrResponse): void; setServiceProperties(serviceProperties: common.models.ServicePropertiesResult.ServiceProperties, callback: ErrorOrResponse): void; - + + /** + * Sets the tier of a pageblob under a premium storage account. + * + * @this {BlobService} + * @param {string} container The container name. + * @param {string} blob The blob name. + * @param {string} blobTier Please see BlobUtilities.BlobTier.PremiumPageBlobTier for possible values. + * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. + * Please see StorageUtilities.LocationMode for the possible values. + * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. + * @param {int} [options.clientRequestTimeoutInMs] The timeout of client requests, in milliseconds, to use for the request. + * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request. + * The maximum execution time interval begins at the time that the client begins building the request. The maximum + * execution time is checked intermittently while performing requests, and before executing retries. + * @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit. + * @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. + * The default value is false. + * @param {errorOrResponse} callback `error` will contain information + * if an error occurs; otherwise, `response` + * will contain information related to this operation. + */ + setBlobTier(container: string, blob: string, blobTier: string, options: common.RequestOptions, callback: ErrorOrResponse): void; + setBlobTier(container: string, blob: string, blobTier: string, callback: ErrorOrResponse): void; + /** * Lists a segment containing a collection of container items under the specified account. * @@ -1387,6 +1411,7 @@ declare module azurestorage { * @param {string} targetContainer The target container name. * @param {string} targetBlob The target blob name. * @param {object} [options] The request options. + * @param {string} [options.blobTier] For page blobs on premium accounts only. Set the tier of target blob. Refer to BlobUtilities.BlobTier.PremiumPageBlobTier. * @param {string} [options.snapshotId] The source blob snapshot identifier. * @param {object} [options.metadata] The target blob metadata key/value pairs. * @param {string} [options.leaseId] The target blob lease identifier. @@ -1514,6 +1539,7 @@ declare module azurestorage { * @param {bool} [options.storeBlobContentMD5] Specifies whether the blob's ContentMD5 header should be set on uploads. * The default value is false for page blobs. * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions. + * @param {string} [options.blobTier] For page blobs on premium accounts only. Set the tier of the target blob. Refer to BlobUtilities.BlobTier.PremiumPageBlobTier. * @param {string} [options.contentSettings.contentType] The MIME content type of the blob. The default type is application/octet-stream. * @param {string} [options.contentSettings.contentEncoding] The content encodings that have been applied to the blob. * @param {string} [options.contentSettings.contentLanguage] The natural languages used by this resource. @@ -1598,6 +1624,7 @@ declare module azurestorage { * @param {bool} [options.storeBlobContentMD5] Specifies whether the blob's ContentMD5 header should be set on uploads. * The default value is false for page blobs. * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions. + * @param {string} [options.blobTier] For page blobs on premium accounts only. Set the tier of the target blob. Refer to BlobUtilities.BlobTier.PremiumPageBlobTier. * @param {string} [options.contentSettings.contentType] The MIME content type of the blob. The default type is application/octet-stream. * @param {string} [options.contentSettings.contentEncoding] The content encodings that have been applied to the blob. * @param {string} [options.contentSettings.contentLanguage] The natural languages used by this resource. @@ -1682,6 +1709,7 @@ declare module azurestorage { * @param {bool} [options.storeBlobContentMD5] Specifies whether the blob's ContentMD5 header should be set on uploads. * The default value is false for page blobs and true for block blobs. * @param {bool} [options.useTransactionalMD5] Calculate and send/validate content MD5 for transactions. + * @param {string} [options.blobTier] For page blobs on premium accounts only. Set the tier of the target blob. Refer to BlobUtilities.BlobTier.PremiumPageBlobTier. * @param {string} [options.contentSettings.contentType] The MIME content type of the blob. The default type is application/octet-stream. * @param {string} [options.contentSettings.contentEncoding] The content encodings that have been applied to the blob. * @param {string} [options.contentSettings.contentLanguage] The natural languages used by this resource. @@ -2846,6 +2874,8 @@ declare module azurestorage { lastModified: string; contentLength: string; blobType: string; + accessTier?: string; + accessTierInferred?: boolean; isIncrementalCopy?: boolean; requestId: string; sequenceNumber?: string; @@ -2884,6 +2914,7 @@ declare module azurestorage { metadata?: Object; leaseId?: string; transactionalContentMD5?: string; + blobTier?: string; contentSettings?: { contentType?: string; contentEncoding?: string; @@ -3026,6 +3057,18 @@ declare module azurestorage { UPDATE: string; INCREMENT: string; }; + BlobTier: { + PremiumPageBlobTier: { + P4: string; + P6: string; + P10: string; + P20: string; + P30: string; + P40: string; + P50: string; + P60: string; + }; + } }; } } From d5d3e191e91b7ad9a0a36f1ec501fe3cbe195400 Mon Sep 17 00:00:00 2001 From: jiacfan Date: Wed, 2 Aug 2017 16:10:23 +0800 Subject: [PATCH 05/10] File Server Encryption. --- ChangeLog.md | 6 +- lib/common/services/storageserviceclient.js | 10 +- lib/common/util/constants.js | 141 ++++-- lib/services/blob/models/blobresult.js | 6 +- lib/services/file/models/directoryresult.js | 4 +- lib/services/file/models/fileresult.js | 6 +- test/framework/test-suite.js | 20 +- test/recordings/blobservice-sse-tests.nock.js | 301 +++++++++++++ test/recordings/fileservice-sse-tests.nock.js | 413 ++++++++++++++++++ test/services/blob/blobservice-sse-tests.js | 168 +++++++ test/services/blob/blobservice-tests.js | 2 +- test/services/file/fileservice-sse-tests.js | 201 +++++++++ typings/azure-storage/azure-storage.d.ts | 3 + 13 files changed, 1223 insertions(+), 58 deletions(-) create mode 100644 test/recordings/blobservice-sse-tests.nock.js create mode 100644 test/recordings/fileservice-sse-tests.nock.js create mode 100644 test/services/blob/blobservice-sse-tests.js create mode 100644 test/services/file/fileservice-sse-tests.js diff --git a/ChangeLog.md b/ChangeLog.md index 137cc3ef..c943c4bf 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -5,10 +5,14 @@ be taken. This is a GA release and the changes described below indicate the chan ALL * Updated storage service version to 2017-04-17. Fore more information, please see - https://docs.microsoft.com/en-us/rest/api/storageservices/versioning-for-the-azure-storage-services +* Added `requestServerEncrypted` property to `ServiceResponse` which indicates if the contents of the request have been successfully encrypted. BLOB * PageBlobs: For Premium Accounts only, added support for getting and setting the tier on a page blob. The tier can also be set when creating or copying from an existing page blob. +FILE +* Added `serverEncryped` property to `FileResult` and `DirectoryResult` which indicates if the file data and application metadata are completely encrypted using the specified algorithm on the server. + 2017.08 Version 2.2.2 ALL @@ -143,7 +147,7 @@ ALL BLOB * Fixed the issue that the service error message will be written to the destination stream if getting error when downloading the blob to a stream/file. -* Added `serverEncryped` property to 'BlobResult' class which indicates if the blob data and application metadata are completely encrypted using the specified algorithm on the server. +* Added `serverEncryped` property to `BlobResult` class which indicates if the blob data and application metadata are completely encrypted using the specified algorithm on the server. FILE * Fixed the issue that the service error message will be written to the destination stream if getting error when downloading the file to a stream/file. diff --git a/lib/common/services/storageserviceclient.js b/lib/common/services/storageserviceclient.js index 1f4d04ed..85870e2d 100644 --- a/lib/common/services/storageserviceclient.js +++ b/lib/common/services/storageserviceclient.js @@ -810,13 +810,21 @@ StorageServiceClient.prototype.withFilter = function (newFilter) { * @return {Object} A response object. */ StorageServiceClient._buildResponse = function (isSuccessful, body, headers, statusCode, md5) { - return { + var response = { isSuccessful: isSuccessful, statusCode: statusCode, body: body, headers: headers, md5: md5 }; + + if (!azureutil.objectIsNull(headers)) { + if (headers[HeaderConstants.REQUEST_SERVER_ENCRYPTED] !== undefined) { + response.requestServerEncrypted = (headers[HeaderConstants.REQUEST_SERVER_ENCRYPTED] === 'true'); + } + } + + return response; }; /** diff --git a/lib/common/util/constants.js b/lib/common/util/constants.js index adf427b9..d2150bea 100644 --- a/lib/common/util/constants.js +++ b/lib/common/util/constants.js @@ -25,11 +25,17 @@ var storageDnsSuffix = process.env.AZURE_STORAGE_DNS_SUFFIX || 'core.windows.net var Constants = { /* * Specifies the value to use for UserAgent header. + * + * @const + * @type {string} */ USER_AGENT_PRODUCT_NAME: 'Azure-Storage', /* * Specifies the value to use for UserAgent header. + * + * @const + * @type {string} */ USER_AGENT_PRODUCT_VERSION: '2.2.2', @@ -37,7 +43,7 @@ var Constants = { * The number of default concurrent requests for parallel operation. * * @const - * @type {string} + * @type {int} */ DEFAULT_PARALLEL_OPERATION_THREAD_COUNT: 5, @@ -45,7 +51,7 @@ var Constants = { * The value of default socket reuse for batch operation. * * @const - * @type {bool} + * @type {boolean} */ DEFAULT_ENABLE_REUSE_SOCKET: true, @@ -53,7 +59,7 @@ var Constants = { * Constant representing a kilobyte (Non-SI version). * * @const - * @type {string} + * @type {int} */ KB: 1024, @@ -61,7 +67,7 @@ var Constants = { * Constant representing a megabyte (Non-SI version). * * @const - * @type {string} + * @type {int} */ MB: 1024 * 1024, @@ -69,7 +75,7 @@ var Constants = { * Constant representing a gigabyte (Non-SI version). * * @const - * @type {string} + * @type {int} */ GB: 1024 * 1024 * 1024, @@ -110,7 +116,7 @@ var Constants = { * Integer containing the number of milliseconds to wait for a server to send response headers (and start the response body) before aborting the request. * 2 minutes by default. * - * @constant + * @const * @type {int} */ DEFAULT_CLIENT_REQUEST_TIMEOUT_IN_MS: 120000, @@ -135,41 +141,44 @@ var Constants = { * Defines the service types indicators. * * @const - * @enum + * @enum {string} */ ServiceType: { Blob: 'blob', Queue: 'queue', Table: 'table', - File: 'file', + File: 'file' }, /** * Specifies the location used to indicate which location the operation can be performed against. * * @const - * @enum + * @enum {int} */ RequestLocationMode: { PRIMARY_ONLY: 0, SECONDARY_ONLY: 1, - PRIMARY_OR_SECONDARY: 2, + PRIMARY_OR_SECONDARY: 2 }, /** * Represents a storage service location. * * @const - * @enum + * @enum {int} */ StorageLocation: { PRIMARY: 0, - SECONDARY: 1, + SECONDARY: 1 }, - + + /** + * Defines constants for use with account SAS. + */ AccountSasConstants:{ /** - * Permission types + * Permission types. * * @const * @enum {string} @@ -186,7 +195,7 @@ var Constants = { }, /** - * Services types + * Services types. * * @const * @enum {string} @@ -195,11 +204,11 @@ var Constants = { BLOB: 'b', FILE: 'f', QUEUE: 'q', - TABLE: 't', + TABLE: 't' }, /** - * Resources types + * Resources types. * * @const * @enum {string} @@ -209,11 +218,17 @@ var Constants = { CONTAINER: 'c', OBJECT: 'o' }, - + + /** + * Protocols types. + * + * @const + * @enum {string} + */ Protocols: { HTTPSONLY: 'https', HTTPSORHTTP: 'https,http' - }, + } }, /** @@ -567,23 +582,35 @@ var Constants = { MAX_SINGLE_UPLOAD_BLOB_SIZE_IN_BYTES: 64 * 1024 * 1024, /** - * The maximum range get size when requesting for a contentMD5 + * The maximum range get size when requesting for a contentMD5. + * + * @const + * @type {int} */ MAX_RANGE_GET_SIZE_WITH_MD5 : 4 * 1024 * 1024, /** * The maximum page range size for a page update operation. + * + * @const + * @type {int} */ MAX_UPDATE_PAGE_SIZE : 4 * 1024 * 1024, /** * The maximum buffer size for writing a stream buffer. + * + * @const + * @type {int} */ MAX_QUEUED_WRITE_DISK_BUFFER_SIZE : 64 * 1024 * 1024, /** - * Max size for single get page range. The max value should be 150MB + * Max size for single get page range. The max value should be 150MB. * http://blogs.msdn.com/b/windowsazurestorage/archive/2012/03/26/getting-the-page-ranges-of-a-large-page-blob-in-segments.aspx + * + * @const + * @type {int} */ MAX_SINGLE_GET_PAGE_RANGE_SIZE : 37 * 4 * 1024 * 1024, @@ -591,7 +618,7 @@ var Constants = { * The size of a page, in bytes, in a page blob. * * @const - * @type {string} + * @type {int} */ PAGE_SIZE: 512, @@ -663,17 +690,23 @@ var Constants = { * The default write size, in bytes, used by file streams. * * @const - * @type {string} + * @type {int} */ DEFAULT_WRITE_SIZE_IN_BYTES: 4 * 1024 * 1024, /** * The maximum range size when requesting for a contentMD5. + * + * @const + * @type {int} */ MAX_RANGE_GET_SIZE_WITH_MD5 : 4 * 1024 * 1024, /** * The maximum range size for a file update operation. + * + * @const + * @type {int} */ MAX_UPDATE_FILE_SIZE : 4 * 1024 * 1024, @@ -718,9 +751,6 @@ var Constants = { /** * Defines constants for use with queue storage. - * - * @const - * @type {string} */ QueueConstants: { /** @@ -742,9 +772,6 @@ var Constants = { /** * Defines constants for use with table storage. - * - * @const - * @type {string} */ TableConstants: { /** @@ -795,7 +822,7 @@ var Constants = { */ NEXT_ROW_KEY: 'NextRowKey', - /** + /** * The next partition key query string argument. * * @const @@ -811,13 +838,19 @@ var Constants = { */ NEXT_TABLE_NAME: 'NextTableName', - /** - * Prefix of the odata properties returned in a JSON query + /** + * Prefix of the odata properties returned in a JSON query. + * + * @const + * @type {string} */ ODATA_PREFIX: 'odata.', /** - * Constant representing the string following a type annotation in a JSON table query + * Constant representing the string following a type annotation in a JSON table query. + * + * @const + * @type {string} */ ODATA_TYPE_SUFFIX: '@odata.type', @@ -831,16 +864,23 @@ var Constants = { /** * Constant representing the value for an entity property. + * + * @const + * @type {string} */ ODATA_VALUE_MARKER: '_', /** * Constant representing the type for an entity property. + * + * @const + * @type {string} */ ODATA_TYPE_MARKER: '$', /** * The value to set the maximum data service version header. + * * @const * @type {string} */ @@ -863,7 +903,7 @@ var Constants = { TABLE_SERVICE_TABLE_NAME: 'Tables', /** - * Operations + * Operations. * * @const * @enum {string} @@ -1093,11 +1133,17 @@ var Constants = { /** * Flag if the blob is incremental copy blob. + * + * @const + * @type {string} */ INCREMENTAL_COPY: 'x-ms-incremental-copy', /** * Snapshot time of the last successful incremental copy snapshot for this blob. + * + * @const + * @type {string} */ COPY_DESTINATION_SNAPSHOT: 'x-ms-copy-destination-snapshot', @@ -1721,7 +1767,7 @@ var Constants = { * The max blob size header. * * @const - * @type {int} + * @type {string} */ BLOB_CONDITION_MAX_SIZE: 'x-ms-blob-condition-maxsize', @@ -1729,7 +1775,7 @@ var Constants = { * The append blob position header. * * @const - * @type {int} + * @type {string} */ BLOB_CONDITION_APPEND_POSITION: 'x-ms-blob-condition-appendpos', @@ -1737,7 +1783,7 @@ var Constants = { * The append blob append offset header. * * @const - * @type {int} + * @type {string} */ BLOB_APPEND_OFFSET: 'x-ms-blob-append-offset', @@ -1745,15 +1791,23 @@ var Constants = { * The append blob committed block header. * * @const - * @type {int} + * @type {string} */ BLOB_COMMITTED_BLOCK_COUNT: 'x-ms-blob-committed-block-count', + /** + * If the contents of the request have been successfully encrypted using the specified algorithm. + * + * @const + * @type {string} + */ + REQUEST_SERVER_ENCRYPTED: 'x-ms-request-server-encrypted', + /** * If the data and application metadata are completely encrypted using the specified algorithm. * * @const - * @type {bool} + * @type {string} */ SERVER_ENCRYPTED: 'x-ms-server-encrypted', @@ -2157,11 +2211,16 @@ var Constants = { StorageServiceClientConstants: { /** * The default protocol. + * + * @const + * @type {string} */ DEFAULT_PROTOCOL: 'https:', /* * Used environment variables. + * + * @const * @enum {string} */ EnvironmentVariables: { @@ -2171,7 +2230,7 @@ var Constants = { AZURE_STORAGE_CONNECTION_STRING: 'AZURE_STORAGE_CONNECTION_STRING', HTTP_PROXY: 'HTTP_PROXY', HTTPS_PROXY: 'HTTPS_PROXY', - EMULATED: 'EMULATED', + EMULATED: 'EMULATED' }, /** @@ -2387,7 +2446,7 @@ var Constants = { CONTAINER_NOT_FOUND: 'ContainerNotFound', CONTAINER_ALREADY_EXISTS: 'ContainerAlreadyExists', CONTAINER_DISABLED: 'ContainerDisabled', - CONTAINER_BEING_DELETED: 'ContainerBeingDeleted', + CONTAINER_BEING_DELETED: 'ContainerBeingDeleted' }, TableErrorCodeStrings: { diff --git a/lib/services/blob/models/blobresult.js b/lib/services/blob/models/blobresult.js index aad61af2..4252313f 100644 --- a/lib/services/blob/models/blobresult.js +++ b/lib/services/blob/models/blobresult.js @@ -95,7 +95,7 @@ BlobResult.parse = function (blobXml) { // convert isIncrementalCopy to boolean type if (blobResult.isIncrementalCopy !== undefined) { - blobResult.isIncrementalCopy = (blobResult.isIncrementalCopy == 'true'); + blobResult.isIncrementalCopy = (blobResult.isIncrementalCopy === 'true'); } return blobResult; @@ -164,7 +164,7 @@ BlobResult.prototype.getPropertiesFromHeaders = function (headers) { }; // For range get, 'x-ms-blob-content-md5' indicate the overall MD5 of the blob. Try to set the contentMD5 using this header if it presents - setBlobPropertyFromHeaders('contentSettings.contentMD5', HeaderConstants['BLOB_CONTENT_MD5']); + setBlobPropertyFromHeaders('contentSettings.contentMD5', HeaderConstants.BLOB_CONTENT_MD5); _.chain(headersForProperties).pairs().each(function (pair) { var property = pair[0]; @@ -174,7 +174,7 @@ BlobResult.prototype.getPropertiesFromHeaders = function (headers) { // convert isIncrementalCopy to boolean type if (self.isIncrementalCopy !== undefined) { - self.isIncrementalCopy = (self.isIncrementalCopy == 'true'); + self.isIncrementalCopy = (self.isIncrementalCopy === 'true'); } // convert accessTierInferred to boolean type diff --git a/lib/services/file/models/directoryresult.js b/lib/services/file/models/directoryresult.js index 2b18f57b..f39d32e8 100644 --- a/lib/services/file/models/directoryresult.js +++ b/lib/services/file/models/directoryresult.js @@ -27,7 +27,8 @@ var HeaderConstants = require('./../../../common/common.core').Constants.HeaderC * @property {string} etag The etag. * @property {string} lastModified The date/time that the directory was last modified. * @property {string} requestId The request id. - * + * @property {string} serverEncrypted If the directory metadata is completely encrypted using the specified algorithm. true/false. + * * @constructor * @param {string} [name] The directory name. */ @@ -51,6 +52,7 @@ DirectoryResult.prototype.getPropertiesFromHeaders = function (headers) { setDirectoryPropertyFromHeaders('etag', HeaderConstants.ETAG); setDirectoryPropertyFromHeaders('lastModified', HeaderConstants.LAST_MODIFIED); setDirectoryPropertyFromHeaders('requestId', HeaderConstants.REQUEST_ID); + setDirectoryPropertyFromHeaders('serverEncrypted', HeaderConstants.SERVER_ENCRYPTED); }; module.exports = DirectoryResult; \ No newline at end of file diff --git a/lib/services/file/models/fileresult.js b/lib/services/file/models/fileresult.js index 2f6557ec..818cdbf3 100644 --- a/lib/services/file/models/fileresult.js +++ b/lib/services/file/models/fileresult.js @@ -35,6 +35,7 @@ var HeaderConstants = Constants.HeaderConstants; * @property {string} lastModified The date/time that the file was last modified. * @property {string} requestId The request id. * @property {string} acceptRanges The accept ranges. + * @property {string} serverEncrypted If the file data and application metadata are completely encrypted using the specified algorithm. true/false. * @property {string} contentRange The content range * @property {string} contentLength The size of the file in bytes. * @property {object} contentSettings The content settings. @@ -114,11 +115,12 @@ FileResult.prototype.getPropertiesFromHeaders = function (headers, content) { }; // For range get, 'x-ms-content-md5' indicate the overall MD5 of the file. Try to set the contentMD5 using this header if it presents - setFilePropertyFromHeaders('contentSettings.contentMD5', HeaderConstants['FILE_CONTENT_MD5']); + setFilePropertyFromHeaders('contentSettings.contentMD5', HeaderConstants.FILE_CONTENT_MD5); setFilePropertyFromHeaders('etag', HeaderConstants.ETAG); setFilePropertyFromHeaders('lastModified', HeaderConstants.LAST_MODIFIED); - setFilePropertyFromHeaders('requestId', HeaderConstants.REQUEST_ID); + setFilePropertyFromHeaders('requestId', HeaderConstants.REQUEST_ID); + setFilePropertyFromHeaders('serverEncrypted', HeaderConstants.SERVER_ENCRYPTED); if (content) { _.chain(responseHeaders).pairs().each(function (pair) { diff --git a/test/framework/test-suite.js b/test/framework/test-suite.js index cee0d45c..04cb8a84 100644 --- a/test/framework/test-suite.js +++ b/test/framework/test-suite.js @@ -32,15 +32,19 @@ function TestSuite(testPrefix, env, forceMocked) { function stripAccessKey(connectionString) { return connectionString.replace(/AccountKey=[^;]+/, 'AccountKey=null'); } - - var requiredEnvironment = [{ - name: 'AZURE_STORAGE_CONNECTION_STRING', + + var requiredEnvironment = [{ + name: 'AZURE_STORAGE_CONNECTION_STRING', secure: stripAccessKey, optional: false - },{ - name: 'AZURE_STORAGE_CONNECTION_STRING_PREMIUM_ACCOUNT', + },{ + name: 'AZURE_STORAGE_CONNECTION_STRING_PREMIUM_ACCOUNT', + secure: stripAccessKey, + optional: true + },{ + name: 'AZURE_STORAGE_CONNECTION_STRING_SSE_ENABLED_ACCOUNT', secure: stripAccessKey, - optional: true + optional: true }]; env = env.concat(requiredEnvironment); @@ -57,7 +61,7 @@ function TestSuite(testPrefix, env, forceMocked) { } this.isRecording = process.env.AZURE_NOCK_RECORD === 'true'; - + this.skipSubscription = true; var nodeVersion = Number(process.version.match(/^v(\d+\.\d+)/)[1]); @@ -121,7 +125,7 @@ _.extend(TestSuite.prototype, { } else if (this.requiresCert && profile.current.currentSubscription.user) { messages.push('This test requires certificate authentication only. The current subscription has an access token. Please switch subscriptions or use azure logout to remove the access token'); } else if(this.requiresCert && !profile.current.currentSubscription.managementCertificate) { - messges.push('This test requires certificate authentication but the current subscription does not have a management certificate. Please use azure account import to obtain one.'); + messages.push('This test requires certificate authentication but the current subscription does not have a management certificate. Please use azure account import to obtain one.'); } else if (this.requiresToken && !profile.current.currentSubscription.user) { messages.push('This test required an access token but the current subscription does not have one. Please use azure login to obtain an access token'); } diff --git a/test/recordings/blobservice-sse-tests.nock.js b/test/recordings/blobservice-sse-tests.nock.js new file mode 100644 index 00000000..41e15fbb --- /dev/null +++ b/test/recordings/blobservice-sse-tests.nock.js @@ -0,0 +1,301 @@ +// This file has been autogenerated. + +exports.setEnvironment = function() { + process.env['AZURE_STORAGE_CONNECTION_STRING'] = 'DefaultEndpointsProtocol=https;AccountName=xplat;AccountKey=null'; + process.env['AZURE_STORAGE_CONNECTION_STRING_SSE_ENABLED_ACCOUNT'] = 'DefaultEndpointsProtocol=https;AccountName=jiacssestg001;AccountKey=null;EndpointSuffix=core.windows.net'; +} + +exports.scopes = [[function (nock) { +var result = +nock('http://jiacssestg001.blob.core.windows.net:443') + .head('/sse-cont-testdata0?restype=container') + .reply(404, "", { 'transfer-encoding': 'chunked', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '5ddd6a96-0001-00e5-02a9-0a2394000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 01 Aug 2017 09:33:01 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://jiacssestg001.blob.core.windows.net:443') + .head('/sse-cont-testdata0?restype=container') + .reply(404, "", { 'transfer-encoding': 'chunked', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '5ddd6a96-0001-00e5-02a9-0a2394000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 01 Aug 2017 09:33:01 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://jiacssestg001.blob.core.windows.net:443') + .head('/sse-cont-testdata0?restype=container') + .reply(404, "", { 'transfer-encoding': 'chunked', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '74525fdf-0001-011a-74a9-0a5859000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 01 Aug 2017 09:33:02 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://jiacssestg001.blob.core.windows.net:443') + .head('/sse-cont-testdata0?restype=container') + .reply(404, "", { 'transfer-encoding': 'chunked', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '74525fdf-0001-011a-74a9-0a5859000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 01 Aug 2017 09:33:02 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://jiacssestg001.blob.core.windows.net:443') + .put('/sse-cont-testdata0?restype=container') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Tue, 01 Aug 2017 09:33:03 GMT', + etag: '"0x8D4D8C04EE6ADFC"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'fe6f71c5-0001-012d-61a9-0af4f6000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 01 Aug 2017 09:33:02 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://jiacssestg001.blob.core.windows.net:443') + .put('/sse-cont-testdata0?restype=container') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Tue, 01 Aug 2017 09:33:03 GMT', + etag: '"0x8D4D8C04EE6ADFC"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'fe6f71c5-0001-012d-61a9-0af4f6000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 01 Aug 2017 09:33:02 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://jiacssestg001.blob.core.windows.net:443') + .filteringRequestBody(function (path) { return '*';}) +.put('/sse-cont-testdata0/sse-blob-testdata1', '*') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'content-md5': 'cKHWQKBK2/WJ81oqInxLIA==', + 'last-modified': 'Tue, 01 Aug 2017 09:33:04 GMT', + etag: '"0x8D4D8C04F76EA35"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'cb756898-0001-0086-80a9-0a65b1000000', + 'x-ms-version': '2017-04-17', + 'x-ms-request-server-encrypted': 'true', + date: 'Tue, 01 Aug 2017 09:33:04 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://jiacssestg001.blob.core.windows.net:443') + .filteringRequestBody(function (path) { return '*';}) +.put('/sse-cont-testdata0/sse-blob-testdata1', '*') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'content-md5': 'cKHWQKBK2/WJ81oqInxLIA==', + 'last-modified': 'Tue, 01 Aug 2017 09:33:04 GMT', + etag: '"0x8D4D8C04F76EA35"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'cb756898-0001-0086-80a9-0a65b1000000', + 'x-ms-version': '2017-04-17', + 'x-ms-request-server-encrypted': 'true', + date: 'Tue, 01 Aug 2017 09:33:04 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://jiacssestg001.blob.core.windows.net:443') + .put('/sse-cont-testdata0/sse-blob-testdata1?comp=metadata') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Tue, 01 Aug 2017 09:33:05 GMT', + etag: '"0x8D4D8C0500D2A67"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '9328712d-0001-011f-14a9-0aac26000000', + 'x-ms-version': '2017-04-17', + 'x-ms-request-server-encrypted': 'true', + date: 'Tue, 01 Aug 2017 09:33:05 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://jiacssestg001.blob.core.windows.net:443') + .put('/sse-cont-testdata0/sse-blob-testdata1?comp=metadata') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Tue, 01 Aug 2017 09:33:05 GMT', + etag: '"0x8D4D8C0500D2A67"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '9328712d-0001-011f-14a9-0aac26000000', + 'x-ms-version': '2017-04-17', + 'x-ms-request-server-encrypted': 'true', + date: 'Tue, 01 Aug 2017 09:33:05 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://jiacssestg001.blob.core.windows.net:443') + .get('/sse-cont-testdata0/sse-blob-testdata1') + .reply(200, "sseTestBlob", { 'content-length': '11', + 'content-type': 'application/octet-stream', + 'content-md5': 'cKHWQKBK2/WJ81oqInxLIA==', + 'last-modified': 'Tue, 01 Aug 2017 09:33:05 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D4D8C0500D2A67"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '15b332f1-0001-012b-26a9-0a038e000000', + 'x-ms-version': '2017-04-17', + 'x-ms-meta-testkey': 'testValue', + 'x-ms-lease-status': 'unlocked', + 'x-ms-lease-state': 'available', + 'x-ms-blob-type': 'BlockBlob', + 'x-ms-server-encrypted': 'true', + date: 'Tue, 01 Aug 2017 09:33:05 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://jiacssestg001.blob.core.windows.net:443') + .get('/sse-cont-testdata0/sse-blob-testdata1') + .reply(200, "sseTestBlob", { 'content-length': '11', + 'content-type': 'application/octet-stream', + 'content-md5': 'cKHWQKBK2/WJ81oqInxLIA==', + 'last-modified': 'Tue, 01 Aug 2017 09:33:05 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D4D8C0500D2A67"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '15b332f1-0001-012b-26a9-0a038e000000', + 'x-ms-version': '2017-04-17', + 'x-ms-meta-testkey': 'testValue', + 'x-ms-lease-status': 'unlocked', + 'x-ms-lease-state': 'available', + 'x-ms-blob-type': 'BlockBlob', + 'x-ms-server-encrypted': 'true', + date: 'Tue, 01 Aug 2017 09:33:05 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://jiacssestg001.blob.core.windows.net:443') + .head('/sse-cont-testdata0/sse-blob-testdata1') + .reply(200, "", { 'content-length': '11', + 'content-type': 'application/octet-stream', + 'content-md5': 'cKHWQKBK2/WJ81oqInxLIA==', + 'last-modified': 'Tue, 01 Aug 2017 09:33:05 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D4D8C0500D2A67"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '28842bfd-0001-0125-14a9-0aef85000000', + 'x-ms-version': '2017-04-17', + 'x-ms-meta-testkey': 'testValue', + 'x-ms-lease-status': 'unlocked', + 'x-ms-lease-state': 'available', + 'x-ms-blob-type': 'BlockBlob', + 'x-ms-server-encrypted': 'true', + date: 'Tue, 01 Aug 2017 09:33:07 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://jiacssestg001.blob.core.windows.net:443') + .head('/sse-cont-testdata0/sse-blob-testdata1') + .reply(200, "", { 'content-length': '11', + 'content-type': 'application/octet-stream', + 'content-md5': 'cKHWQKBK2/WJ81oqInxLIA==', + 'last-modified': 'Tue, 01 Aug 2017 09:33:05 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D4D8C0500D2A67"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '28842bfd-0001-0125-14a9-0aef85000000', + 'x-ms-version': '2017-04-17', + 'x-ms-meta-testkey': 'testValue', + 'x-ms-lease-status': 'unlocked', + 'x-ms-lease-state': 'available', + 'x-ms-blob-type': 'BlockBlob', + 'x-ms-server-encrypted': 'true', + date: 'Tue, 01 Aug 2017 09:33:07 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://jiacssestg001.blob.core.windows.net:443') + .head('/sse-cont-testdata0/sse-blob-testdata1?comp=metadata') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Tue, 01 Aug 2017 09:33:05 GMT', + etag: '"0x8D4D8C0500D2A67"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '72538d3c-0001-0042-3da9-0a1a77000000', + 'x-ms-version': '2017-04-17', + 'x-ms-meta-testkey': 'testValue', + date: 'Tue, 01 Aug 2017 09:33:07 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://jiacssestg001.blob.core.windows.net:443') + .head('/sse-cont-testdata0/sse-blob-testdata1?comp=metadata') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Tue, 01 Aug 2017 09:33:05 GMT', + etag: '"0x8D4D8C0500D2A67"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '72538d3c-0001-0042-3da9-0a1a77000000', + 'x-ms-version': '2017-04-17', + 'x-ms-meta-testkey': 'testValue', + date: 'Tue, 01 Aug 2017 09:33:07 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://jiacssestg001.blob.core.windows.net:443') + .head('/sse-cont-testdata0?restype=container') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Tue, 01 Aug 2017 09:33:03 GMT', + etag: '"0x8D4D8C04EE6ADFC"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'c2c67c7a-0001-0063-72a9-0a7746000000', + 'x-ms-version': '2017-04-17', + 'x-ms-lease-status': 'unlocked', + 'x-ms-lease-state': 'available', + date: 'Tue, 01 Aug 2017 09:33:07 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://jiacssestg001.blob.core.windows.net:443') + .head('/sse-cont-testdata0?restype=container') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Tue, 01 Aug 2017 09:33:03 GMT', + etag: '"0x8D4D8C04EE6ADFC"', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'c2c67c7a-0001-0063-72a9-0a7746000000', + 'x-ms-version': '2017-04-17', + 'x-ms-lease-status': 'unlocked', + 'x-ms-lease-state': 'available', + date: 'Tue, 01 Aug 2017 09:33:07 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://jiacssestg001.blob.core.windows.net:443') + .delete('/sse-cont-testdata0?restype=container') + .reply(202, "", { 'transfer-encoding': 'chunked', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'c7208dba-0001-0084-76a9-0a674b000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 01 Aug 2017 09:33:10 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://jiacssestg001.blob.core.windows.net:443') + .delete('/sse-cont-testdata0?restype=container') + .reply(202, "", { 'transfer-encoding': 'chunked', + server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'c7208dba-0001-0084-76a9-0a674b000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 01 Aug 2017 09:33:10 GMT', + connection: 'close' }); + return result; }]]; \ No newline at end of file diff --git a/test/recordings/fileservice-sse-tests.nock.js b/test/recordings/fileservice-sse-tests.nock.js new file mode 100644 index 00000000..f2cd0453 --- /dev/null +++ b/test/recordings/fileservice-sse-tests.nock.js @@ -0,0 +1,413 @@ +// This file has been autogenerated. + +exports.setEnvironment = function() { + process.env['AZURE_STORAGE_CONNECTION_STRING'] = 'DefaultEndpointsProtocol=https;AccountName=xplat;AccountKey=null'; + process.env['AZURE_STORAGE_CONNECTION_STRING_SSE_ENABLED_ACCOUNT'] = 'DefaultEndpointsProtocol=https;AccountName=jiacssestg001;AccountKey=null;EndpointSuffix=core.windows.net'; +} + +exports.scopes = [[function (nock) { +var result = +nock('http://jiacssestg001.file.core.windows.net:443') + .head('/sse-file-test-share-testdata0?restype=share') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Tue, 01 Aug 2017 03:19:34 GMT', + etag: '"0x8D4D88C220455B4"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'a4bdb381-001a-0138-34ab-0a366f000000', + 'x-ms-version': '2017-04-17', + 'x-ms-share-quota': '5120', + date: 'Tue, 01 Aug 2017 09:50:51 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://jiacssestg001.file.core.windows.net:443') + .head('/sse-file-test-share-testdata0?restype=share') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Tue, 01 Aug 2017 03:19:34 GMT', + etag: '"0x8D4D88C220455B4"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'a4bdb381-001a-0138-34ab-0a366f000000', + 'x-ms-version': '2017-04-17', + 'x-ms-share-quota': '5120', + date: 'Tue, 01 Aug 2017 09:50:51 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://jiacssestg001.file.core.windows.net:443') + .head('/sse-file-test-share-testdata0/sse-dir-testdata1?restype=directory') + .reply(404, "", { 'transfer-encoding': 'chunked', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '4bbe14ee-001a-0026-18ab-0aaad7000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 01 Aug 2017 09:50:51 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://jiacssestg001.file.core.windows.net:443') + .head('/sse-file-test-share-testdata0/sse-dir-testdata1?restype=directory') + .reply(404, "", { 'transfer-encoding': 'chunked', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '4bbe14ee-001a-0026-18ab-0aaad7000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 01 Aug 2017 09:50:51 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://jiacssestg001.file.core.windows.net:443') + .put('/sse-file-test-share-testdata0/sse-dir-testdata1?restype=directory') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Tue, 01 Aug 2017 09:50:54 GMT', + etag: '"0x8D4D8C2CD09FA99"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '9483b1cd-001a-010f-6aab-0a9ac0000000', + 'x-ms-version': '2017-04-17', + 'x-ms-request-server-encrypted': 'true', + date: 'Tue, 01 Aug 2017 09:50:53 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://jiacssestg001.file.core.windows.net:443') + .put('/sse-file-test-share-testdata0/sse-dir-testdata1?restype=directory') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Tue, 01 Aug 2017 09:50:54 GMT', + etag: '"0x8D4D8C2CD09FA99"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '9483b1cd-001a-010f-6aab-0a9ac0000000', + 'x-ms-version': '2017-04-17', + 'x-ms-request-server-encrypted': 'true', + date: 'Tue, 01 Aug 2017 09:50:53 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://jiacssestg001.file.core.windows.net:443') + .head('/sse-file-test-share-testdata0/sse-dir-testdata1/sse-file-testdata2') + .reply(404, "", { 'transfer-encoding': 'chunked', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'e50fcc38-001a-011d-64ab-0aaedc000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 01 Aug 2017 09:50:51 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://jiacssestg001.file.core.windows.net:443') + .head('/sse-file-test-share-testdata0/sse-dir-testdata1/sse-file-testdata2') + .reply(404, "", { 'transfer-encoding': 'chunked', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'e50fcc38-001a-011d-64ab-0aaedc000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 01 Aug 2017 09:50:51 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://jiacssestg001.file.core.windows.net:443') + .put('/sse-file-test-share-testdata0/sse-dir-testdata1/sse-file-testdata2') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Tue, 01 Aug 2017 09:50:56 GMT', + etag: '"0x8D4D8C2CE367DD5"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '4da9b44e-001a-00cc-72ab-0a55d6000000', + 'x-ms-version': '2017-04-17', + 'x-ms-request-server-encrypted': 'true', + date: 'Tue, 01 Aug 2017 09:50:54 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://jiacssestg001.file.core.windows.net:443') + .put('/sse-file-test-share-testdata0/sse-dir-testdata1/sse-file-testdata2') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Tue, 01 Aug 2017 09:50:56 GMT', + etag: '"0x8D4D8C2CE367DD5"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '4da9b44e-001a-00cc-72ab-0a55d6000000', + 'x-ms-version': '2017-04-17', + 'x-ms-request-server-encrypted': 'true', + date: 'Tue, 01 Aug 2017 09:50:54 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://jiacssestg001.file.core.windows.net:443') + .filteringRequestBody(function (path) { return '*';}) +.put('/sse-file-test-share-testdata0/sse-dir-testdata1/sse-file-testdata2?comp=range', '*') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'content-md5': 'qm5hLGD13lkvHmMfcn1Kww==', + 'last-modified': 'Tue, 01 Aug 2017 09:50:57 GMT', + etag: '"0x8D4D8C2CED04292"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'b8ab07b4-001a-0046-6aab-0aeff5000000', + 'x-ms-version': '2017-04-17', + 'x-ms-request-server-encrypted': 'true', + date: 'Tue, 01 Aug 2017 09:50:55 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://jiacssestg001.file.core.windows.net:443') + .filteringRequestBody(function (path) { return '*';}) +.put('/sse-file-test-share-testdata0/sse-dir-testdata1/sse-file-testdata2?comp=range', '*') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'content-md5': 'qm5hLGD13lkvHmMfcn1Kww==', + 'last-modified': 'Tue, 01 Aug 2017 09:50:57 GMT', + etag: '"0x8D4D8C2CED04292"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'b8ab07b4-001a-0046-6aab-0aeff5000000', + 'x-ms-version': '2017-04-17', + 'x-ms-request-server-encrypted': 'true', + date: 'Tue, 01 Aug 2017 09:50:55 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://jiacssestg001.file.core.windows.net:443') + .put('/sse-file-test-share-testdata0/sse-dir-testdata1/sse-file-testdata2?comp=properties') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Tue, 01 Aug 2017 09:50:58 GMT', + etag: '"0x8D4D8C2CF68F5A3"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'b832d982-001a-00bd-5dab-0a27ef000000', + 'x-ms-version': '2017-04-17', + 'x-ms-request-server-encrypted': 'true', + date: 'Tue, 01 Aug 2017 09:50:57 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://jiacssestg001.file.core.windows.net:443') + .put('/sse-file-test-share-testdata0/sse-dir-testdata1/sse-file-testdata2?comp=properties') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Tue, 01 Aug 2017 09:50:58 GMT', + etag: '"0x8D4D8C2CF68F5A3"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'b832d982-001a-00bd-5dab-0a27ef000000', + 'x-ms-version': '2017-04-17', + 'x-ms-request-server-encrypted': 'true', + date: 'Tue, 01 Aug 2017 09:50:57 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://jiacssestg001.file.core.windows.net:443') + .head('/sse-file-test-share-testdata0/sse-dir-testdata1?restype=directory') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Tue, 01 Aug 2017 09:50:54 GMT', + etag: '"0x8D4D8C2CD09FA99"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'd8f23b5a-001a-0113-7aab-0a42d7000000', + 'x-ms-version': '2017-04-17', + 'x-ms-server-encrypted': 'true', + date: 'Tue, 01 Aug 2017 09:50:57 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://jiacssestg001.file.core.windows.net:443') + .head('/sse-file-test-share-testdata0/sse-dir-testdata1?restype=directory') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Tue, 01 Aug 2017 09:50:54 GMT', + etag: '"0x8D4D8C2CD09FA99"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'd8f23b5a-001a-0113-7aab-0a42d7000000', + 'x-ms-version': '2017-04-17', + 'x-ms-server-encrypted': 'true', + date: 'Tue, 01 Aug 2017 09:50:57 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://jiacssestg001.file.core.windows.net:443') + .get('/sse-file-test-share-testdata0/sse-dir-testdata1/sse-file-testdata2') + .reply(200, "sseTestFile", { 'content-length': '11', + 'last-modified': 'Tue, 01 Aug 2017 09:50:58 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D4D8C2CF68F5A3"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '194666a0-001a-010c-71ab-0a99c7000000', + 'x-ms-version': '2017-04-17', + 'x-ms-type': 'File', + 'x-ms-server-encrypted': 'true', + date: 'Tue, 01 Aug 2017 09:50:58 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://jiacssestg001.file.core.windows.net:443') + .get('/sse-file-test-share-testdata0/sse-dir-testdata1/sse-file-testdata2') + .reply(200, "sseTestFile", { 'content-length': '11', + 'last-modified': 'Tue, 01 Aug 2017 09:50:58 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D4D8C2CF68F5A3"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '194666a0-001a-010c-71ab-0a99c7000000', + 'x-ms-version': '2017-04-17', + 'x-ms-type': 'File', + 'x-ms-server-encrypted': 'true', + date: 'Tue, 01 Aug 2017 09:50:58 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://jiacssestg001.file.core.windows.net:443') + .head('/sse-file-test-share-testdata0/sse-dir-testdata1/sse-file-testdata2') + .reply(200, "", { 'content-length': '11', + 'last-modified': 'Tue, 01 Aug 2017 09:50:58 GMT', + etag: '"0x8D4D8C2CF68F5A3"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '6c56da98-001a-007a-4bab-0a5b2e000000', + 'x-ms-version': '2017-04-17', + 'x-ms-type': 'File', + 'x-ms-server-encrypted': 'true', + date: 'Tue, 01 Aug 2017 09:50:59 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://jiacssestg001.file.core.windows.net:443') + .head('/sse-file-test-share-testdata0/sse-dir-testdata1/sse-file-testdata2') + .reply(200, "", { 'content-length': '11', + 'last-modified': 'Tue, 01 Aug 2017 09:50:58 GMT', + etag: '"0x8D4D8C2CF68F5A3"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '6c56da98-001a-007a-4bab-0a5b2e000000', + 'x-ms-version': '2017-04-17', + 'x-ms-type': 'File', + 'x-ms-server-encrypted': 'true', + date: 'Tue, 01 Aug 2017 09:50:59 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://jiacssestg001.file.core.windows.net:443') + .head('/sse-file-test-share-testdata0/sse-dir-testdata1?restype=directory&comp=metadata') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Tue, 01 Aug 2017 09:50:54 GMT', + etag: '"0x8D4D8C2CD09FA99"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '7ecad02e-001a-0015-3eab-0af3fa000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 01 Aug 2017 09:51:00 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://jiacssestg001.file.core.windows.net:443') + .head('/sse-file-test-share-testdata0/sse-dir-testdata1?restype=directory&comp=metadata') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Tue, 01 Aug 2017 09:50:54 GMT', + etag: '"0x8D4D8C2CD09FA99"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '7ecad02e-001a-0015-3eab-0af3fa000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 01 Aug 2017 09:51:00 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://jiacssestg001.file.core.windows.net:443') + .head('/sse-file-test-share-testdata0/sse-dir-testdata1/sse-file-testdata2') + .reply(200, "", { 'content-length': '11', + 'last-modified': 'Tue, 01 Aug 2017 09:50:58 GMT', + etag: '"0x8D4D8C2CF68F5A3"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '52e02dc7-001a-005e-2eab-0ac260000000', + 'x-ms-version': '2017-04-17', + 'x-ms-type': 'File', + 'x-ms-server-encrypted': 'true', + date: 'Tue, 01 Aug 2017 09:51:02 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://jiacssestg001.file.core.windows.net:443') + .head('/sse-file-test-share-testdata0/sse-dir-testdata1/sse-file-testdata2') + .reply(200, "", { 'content-length': '11', + 'last-modified': 'Tue, 01 Aug 2017 09:50:58 GMT', + etag: '"0x8D4D8C2CF68F5A3"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '52e02dc7-001a-005e-2eab-0ac260000000', + 'x-ms-version': '2017-04-17', + 'x-ms-type': 'File', + 'x-ms-server-encrypted': 'true', + date: 'Tue, 01 Aug 2017 09:51:02 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://jiacssestg001.file.core.windows.net:443') + .delete('/sse-file-test-share-testdata0/sse-dir-testdata1/sse-file-testdata2') + .reply(202, "", { 'transfer-encoding': 'chunked', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '0b6bd737-001a-0000-2eab-0a3163000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 01 Aug 2017 09:51:03 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://jiacssestg001.file.core.windows.net:443') + .delete('/sse-file-test-share-testdata0/sse-dir-testdata1/sse-file-testdata2') + .reply(202, "", { 'transfer-encoding': 'chunked', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '0b6bd737-001a-0000-2eab-0a3163000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 01 Aug 2017 09:51:03 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://jiacssestg001.file.core.windows.net:443') + .head('/sse-file-test-share-testdata0/sse-dir-testdata1?restype=directory') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Tue, 01 Aug 2017 09:50:54 GMT', + etag: '"0x8D4D8C2CD09FA99"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '65f96e5a-001a-00e9-57ab-0acd65000000', + 'x-ms-version': '2017-04-17', + 'x-ms-server-encrypted': 'true', + date: 'Tue, 01 Aug 2017 09:51:03 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://jiacssestg001.file.core.windows.net:443') + .head('/sse-file-test-share-testdata0/sse-dir-testdata1?restype=directory') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Tue, 01 Aug 2017 09:50:54 GMT', + etag: '"0x8D4D8C2CD09FA99"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '65f96e5a-001a-00e9-57ab-0acd65000000', + 'x-ms-version': '2017-04-17', + 'x-ms-server-encrypted': 'true', + date: 'Tue, 01 Aug 2017 09:51:03 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://jiacssestg001.file.core.windows.net:443') + .delete('/sse-file-test-share-testdata0/sse-dir-testdata1?restype=directory') + .reply(202, "", { 'transfer-encoding': 'chunked', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '8f654ff8-001a-00f6-1cab-0a1675000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 01 Aug 2017 09:51:05 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://jiacssestg001.file.core.windows.net:443') + .delete('/sse-file-test-share-testdata0/sse-dir-testdata1?restype=directory') + .reply(202, "", { 'transfer-encoding': 'chunked', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '8f654ff8-001a-00f6-1cab-0a1675000000', + 'x-ms-version': '2017-04-17', + date: 'Tue, 01 Aug 2017 09:51:05 GMT', + connection: 'close' }); + return result; }]]; \ No newline at end of file diff --git a/test/services/blob/blobservice-sse-tests.js b/test/services/blob/blobservice-sse-tests.js new file mode 100644 index 00000000..9272956c --- /dev/null +++ b/test/services/blob/blobservice-sse-tests.js @@ -0,0 +1,168 @@ +// +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +var assert = require('assert'); + +// Test includes +var testutil = require('../../framework/util'); +var TestSuite = require('../../framework/test-suite'); + +// Lib includes +var azure = testutil.libRequire('azure-storage'); +var azureutil = testutil.libRequire('/common/util/util'); + +var blobSseSuite = new TestSuite('blobservice-sse-tests'); +var sseEnabledAccountConnectionString = process.env.AZURE_STORAGE_CONNECTION_STRING_SSE_ENABLED_ACCOUNT; +var runSseSuite = !azureutil.IsNullOrEmptyOrUndefinedOrWhiteSpace(sseEnabledAccountConnectionString) || blobSseSuite.isPlayback(); +var runSseCase = runSseSuite ? it : it.skip; + +var containerNamesPrefix = 'sse-cont-'; +var blobNamesPrefix = 'sse-blob-'; + +var blobService; +var containerName; +var blobName; + +describe('BlobServiceStorageServiceEncryption', function () { + before(function (done) { + if (!runSseSuite) { + done(); + } else { + if (blobSseSuite.isMocked) { + testutil.POLL_REQUEST_INTERVAL = 0; + } + blobSseSuite.setupSuite(function () { + sseEnabledAccountConnectionString = process.env.AZURE_STORAGE_CONNECTION_STRING_SSE_ENABLED_ACCOUNT; + blobService = azure.createBlobService(sseEnabledAccountConnectionString).withFilter(new azure.ExponentialRetryPolicyFilter()); + containerName = blobSseSuite.getName(containerNamesPrefix).toLowerCase(); + blobName = blobSseSuite.getName(blobNamesPrefix).toLowerCase(); + + done(); + }); + } + }); + + after(function (done) { + if (!runSseSuite) { + done(); + } else { + blobSseSuite.teardownSuite(done); + } + }); + + beforeEach(function (done) { + if (!runSseSuite) { + done(); + } else { + blobSseSuite.setupTest(done); + } + }); + + afterEach(function (done) { + if (!runSseSuite) { + done(); + } else { + blobSseSuite.teardownTest(done); + } + }); + + describe('create container and blob for blob SSE testing', function () { + runSseCase('should work', function (done) { + blobService.deleteContainerIfExists(containerName, function (deleteError) { + assert.equal(deleteError, null); + + blobService.createContainerIfNotExists(containerName, function (createError, container) { + assert.equal(createError, null); + assert.notEqual(container, null); + + var blobText = "sseTestBlob"; + blobService.createBlockBlobFromText(containerName, blobName, blobText, function (uploadError, blob, uploadResponse) { + assert.equal(uploadError, null); + assert.ok(uploadResponse.isSuccessful); + assert.strictEqual(uploadResponse.requestServerEncrypted, true); + + done(); + }); + }); + }); + }); + }); + + describe('setBlobMetadata', function () { + runSseCase('should contain requestServerEncrypted in response', function (done) { + blobService.setBlobMetadata(containerName, blobName, {'testKey': 'testValue'}, function (error, blobResult, response) { + assert.equal(error, null); + assert.ok(response.isSuccessful); + assert.notEqual(blobResult, null); + assert.strictEqual(blobResult.serverEncrypted, undefined); // TODO: Backward compatibility, plan to switch serverEncrypted's type to boolean in next major release. + assert.strictEqual(response.requestServerEncrypted, true); + + done(); + }); + }); + }); + + describe('getBlobToText', function () { + runSseCase('should contain property serverEncrypted in blobResult', function (done) { + blobService.getBlobToText(containerName, blobName, function (error, blobText, blobResult, response) { + assert.equal(error, null); + assert.ok(response.isSuccessful); + assert.notEqual(blobResult, null); + assert.strictEqual(blobResult.serverEncrypted, "true"); // TODO: Backward compatibility, plan to switch serverEncrypted's type to boolean in next major release. + assert.strictEqual(response.requestServerEncrypted, undefined); + + done(); + }); + }); + }); + + describe('getBlobProperties', function () { + runSseCase('should contain property serverEncrypted in blobResult', function (done) { + blobService.getBlobProperties(containerName, blobName, function (error, blobResult) { + assert.equal(error, null); + assert.notEqual(blobResult, null); + assert.strictEqual(blobResult.serverEncrypted, "true"); // TODO: Backward compatibility, plan to switch serverEncrypted's type to boolean in next major release. + + done(); + }); + }); + }); + + describe('getBlobMetadata', function () { + runSseCase('should not contain property serverEncrypted in blobResult and requestServerEncrypted in response', function (done) { + blobService.getBlobMetadata(containerName, blobName, function (error, blobResult, response) { + assert.equal(error, null); + assert.ok(response.isSuccessful); + assert.notEqual(blobResult, null); + assert.strictEqual(blobResult.serverEncrypted, undefined); // TODO: Backward compatibility, plan to switch serverEncrypted's type to boolean in next major release. + assert.strictEqual(response.requestServerEncrypted, undefined); + + done(); + }); + }); + }); + + describe('delete container for blob SSE testing', function () { + runSseCase('should work', function (done) { + blobService.deleteContainerIfExists(containerName, function (deleteError) { + assert.equal(deleteError, null); + + done(); + }); + }); + }); + +}); // outer describe end \ No newline at end of file diff --git a/test/services/blob/blobservice-tests.js b/test/services/blob/blobservice-tests.js index ed85893a..1616a159 100644 --- a/test/services/blob/blobservice-tests.js +++ b/test/services/blob/blobservice-tests.js @@ -656,7 +656,7 @@ describe('BlobService', function () { assert.equal(getErr, null); assert.notEqual(blob, null); - assert.notEqual(blob.serverEncrypted, false); + assert.strictEqual(blob.serverEncrypted, "false"); if (blob) { assert.notEqual(blob.metadata, null); diff --git a/test/services/file/fileservice-sse-tests.js b/test/services/file/fileservice-sse-tests.js new file mode 100644 index 00000000..f83ab126 --- /dev/null +++ b/test/services/file/fileservice-sse-tests.js @@ -0,0 +1,201 @@ +// +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +var assert = require('assert'); + +// Test includes +var testutil = require('../../framework/util'); +var TestSuite = require('../../framework/test-suite'); + +// Lib includes +var azure = testutil.libRequire('azure-storage'); +var azureutil = testutil.libRequire('/common/util/util'); + +var fileSseSuite = new TestSuite('fileservice-sse-tests'); +var sseEnabledAccountConnectionString = process.env.AZURE_STORAGE_CONNECTION_STRING_SSE_ENABLED_ACCOUNT; +var runSseSuite = !azureutil.IsNullOrEmptyOrUndefinedOrWhiteSpace(sseEnabledAccountConnectionString) || fileSseSuite.isPlayback(); +var runSseCase = runSseSuite ? it : it.skip; + +var shareNamesPrefix = 'sse-file-test-share-'; +var directoryNamesPrefix = 'sse-dir-'; +var fileNamesPrefix = 'sse-file-'; + +var fileService; +var shareName; +var directoryName; +var fileName; + +describe('FileServiceStorageServiceEncryption', function () { + before(function (done) { + if (!runSseSuite) { + done(); + } else { + if (fileSseSuite.isMocked) { + testutil.POLL_REQUEST_INTERVAL = 0; + } + fileSseSuite.setupSuite(function () { + sseEnabledAccountConnectionString = process.env.AZURE_STORAGE_CONNECTION_STRING_SSE_ENABLED_ACCOUNT; + fileService = azure.createFileService(sseEnabledAccountConnectionString).withFilter(new azure.ExponentialRetryPolicyFilter()); + shareName = fileSseSuite.getName(shareNamesPrefix); + directoryName = fileSseSuite.getName(directoryNamesPrefix); + fileName = fileSseSuite.getName(fileNamesPrefix); + + done(); + }); + } + }); + + after(function (done) { + if (!runSseSuite) { + done(); + } else { + fileSseSuite.teardownSuite(done); + } + }); + + beforeEach(function (done) { + if (!runSseSuite) { + done(); + } else { + fileSseSuite.setupTest(done); + } + }); + + afterEach(function (done) { + if (!runSseSuite) { + done(); + } else { + fileSseSuite.teardownTest(done); + } + }); + + describe('create share, directory and file for file SSE testing', function () { + runSseCase('should work', function (done) { + fileService.createShareIfNotExists(shareName, function (createError) { + assert.equal(createError, null); + + fileService.createDirectoryIfNotExists(shareName, directoryName, function (createError, directoryResult, createResponse) { + assert.equal(createError, null); + assert.ok(createResponse.isSuccessful); + // As Azure document https://docs.microsoft.com/en-us/rest/api/storageservices/create-directory updated at 7/17/2017, + // CreateDirectory should return x-ms-request-server-encrypted but not x-ms-server-encrypted, contacting owner. + // assert.strictEqual(createResponse.headers["x-ms-request-server-encrypted"], "true"); // Assert fail + + fileService.doesFileExist(shareName, directoryName, fileName, function (error, fileResult, response) { + assert.equal(error, null); + if (!azureutil.IsNullOrEmptyOrUndefinedOrWhiteSpace(fileResult) && !fileResult.exists) { + var fileText = "sseTestFile"; + fileService.createFileFromText(shareName, directoryName, fileName, fileText, function (createError, fileResult, createResponse) { + assert.equal(createError, null); + assert.ok(createResponse.isSuccessful); + assert.strictEqual(createResponse.requestServerEncrypted, true); + + done(); + }); + } + }); + }); + }); + }); + }); + + describe('setFileProperties', function () { + runSseCase('should contain requestServerEncrypted in response', function (done) { + fileService.setFileProperties(shareName, directoryName, fileName, {}, function (error, fileResult, response) { + assert.equal(error, null); + assert.ok(response.isSuccessful); + assert.notEqual(fileResult, null); + assert.strictEqual(fileResult.serverEncrypted, undefined); // TODO: Align to blob design, plan to switch serverEncrypted's type to boolean in next major release. + assert.strictEqual(response.requestServerEncrypted, true); + + done(); + }); + }); + }); + + describe('getDirectoryProperties', function () { + runSseCase('should contain property serverEncrypted in directoryResult', function (done) { + fileService.getDirectoryProperties(shareName, directoryName, function (error, directoryResult, response) { + assert.equal(error, null); + assert.ok(response.isSuccessful); + assert.notEqual(directoryResult, null); + assert.strictEqual(directoryResult.serverEncrypted, "true"); // TODO: Align to blob design, plan to switch serverEncrypted's type to boolean in next major release. + assert.strictEqual(response.requestServerEncrypted, undefined); + + done(); + }); + }); + }); + + describe('getFileToText', function () { + runSseCase('should contain property serverEncrypted in fileResult', function (done) { + fileService.getFileToText(shareName, directoryName, fileName, function (error, fileText, fileResult, response) { + assert.equal(error, null); + assert.ok(response.isSuccessful); + assert.notEqual(fileResult, null); + assert.strictEqual(fileResult.serverEncrypted, "true"); // TODO: Align to blob design, plan to switch serverEncrypted's type to boolean in next major release. + assert.strictEqual(response.requestServerEncrypted, undefined); + + done(); + }); + }); + }); + + describe('getFileProperties', function () { + runSseCase('should contain property serverEncrypted in fileResult', function (done) { + fileService.getFileProperties(shareName, directoryName, fileName, function (error, fileResult, response) { + assert.equal(error, null); + assert.ok(response.isSuccessful); + assert.notEqual(fileResult, null); + assert.strictEqual(fileResult.serverEncrypted, "true"); // TODO: Align to blob design, plan to switch serverEncrypted's type to boolean in next major release. + assert.strictEqual(response.requestServerEncrypted, undefined); + + done(); + }); + }); + }); + + describe('getDirectoryMetadata', function () { + runSseCase('should not contain property serverEncrypted in directoryResult and requestServerEncrypted in response', function (done) { + fileService.getDirectoryMetadata(shareName, directoryName, function (error, directoryResult, response) { + assert.equal(error, null); + assert.ok(response.isSuccessful); + assert.notEqual(directoryResult, null); + assert.strictEqual(directoryResult.serverEncrypted, undefined); // TODO: Align to blob design, plan to switch serverEncrypted's type to boolean in next major release. + assert.strictEqual(response.requestServerEncrypted, undefined); + + done(); + }); + }); + }); + + describe('delete file and directory for file SSE testing', function () { + runSseCase('should work', function (done) { + fileService.deleteFileIfExists(shareName, directoryName, fileName, function (deleteError, deleted) { + assert.equal(deleteError, null); + assert.strictEqual(deleted, true); + + fileService.deleteDirectoryIfExists(shareName, directoryName, function (deleteError, deleted) { + assert.equal(deleteError, null); + assert.strictEqual(deleted, true); + + done(); + }); + }); + }); + }); + +}); // outer describe end \ No newline at end of file diff --git a/typings/azure-storage/azure-storage.d.ts b/typings/azure-storage/azure-storage.d.ts index 09dbbeaa..97a34c46 100644 --- a/typings/azure-storage/azure-storage.d.ts +++ b/typings/azure-storage/azure-storage.d.ts @@ -7341,6 +7341,7 @@ declare module azurestorage { lastModified: string; requestId?: string; metadata?: { [key: string]: string; }; + serverEncrypted?: string; exists?: boolean; created?: boolean; } @@ -7356,6 +7357,7 @@ declare module azurestorage { contentRange: string; contentLength: string; metadata?: { [key: string]: string; }; + serverEncrypted?: string; contentSettings?:{ contentEncoding: string; contentLanguage: string; @@ -9313,6 +9315,7 @@ declare module azurestorage { headers?: Map; md5: string; error?: StorageError | Error; + requestServerEncrypted?: boolean; } interface ServiceResult { From 5e7e8f833bd43ed9b33e2594f8f3350b57fe981a Mon Sep 17 00:00:00 2001 From: jiacfan Date: Thu, 10 Aug 2017 20:28:11 +0800 Subject: [PATCH 06/10] Update version number to 2.3.0 and ChangeLog.md --- ChangeLog.md | 7 ++++++- lib/common/util/constants.js | 2 +- package.json | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index c943c4bf..a37c238f 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -4,7 +4,8 @@ be taken. This is a GA release and the changes described below indicate the chan 2017.08 Version 2.3.0 ALL -* Updated storage service version to 2017-04-17. Fore more information, please see - https://docs.microsoft.com/en-us/rest/api/storageservices/versioning-for-the-azure-storage-services +* Updated storage service version to 2017-04-17. For more information, please see - https://docs.microsoft.com/en-us/rest/api/storageservices/versioning-for-the-azure-storage-services +* Updated the dependency of the 'request' module to avoid security vulnerability: (https://snyk.io/test/npm/azure-storage). * Added `requestServerEncrypted` property to `ServiceResponse` which indicates if the contents of the request have been successfully encrypted. BLOB @@ -12,6 +13,10 @@ BLOB FILE * Added `serverEncryped` property to `FileResult` and `DirectoryResult` which indicates if the file data and application metadata are completely encrypted using the specified algorithm on the server. +* Fix a TypeScript issue that SharedAccessPermissions for FileUtilities is missing in type definition file. + +TABLE +* Fix a typo in table query example for combineFilters function. 2017.08 Version 2.2.2 diff --git a/lib/common/util/constants.js b/lib/common/util/constants.js index d2150bea..bec87721 100644 --- a/lib/common/util/constants.js +++ b/lib/common/util/constants.js @@ -37,7 +37,7 @@ var Constants = { * @const * @type {string} */ - USER_AGENT_PRODUCT_VERSION: '2.2.2', + USER_AGENT_PRODUCT_VERSION: '2.3.0', /** * The number of default concurrent requests for parallel operation. diff --git a/package.json b/package.json index f3d007e1..a813f009 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "azure-storage", "author": "Microsoft Corporation", - "version": "2.2.2", + "version": "2.3.0", "description": "Microsoft Azure Storage Client Library for Node.js", "typings": "typings/azure-storage/azure-storage.d.ts", "tags": [ From 6485f9f2f039c047d679eae1c9ee71b64caf7e1d Mon Sep 17 00:00:00 2001 From: jiacfan Date: Fri, 11 Aug 2017 16:57:57 +0800 Subject: [PATCH 07/10] Update CONTRIBUTING.md for version 2.3.0 and optimize the existing testing code. --- CONTRIBUTING.md | 13 ++++++------- test/services/blob/blobservice-tests.js | 18 +++++++++--------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9ea179c8..288c5f37 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,7 +26,7 @@ npm install ## Tests ### Running -Unit tests don't require real credentials and don't require any environment varaibles to be set. By default the unit tests are run with Nock recording data. +Unit tests don't require real credentials and don't require any environment variables to be set. By default the unit tests are run with Nock recording data. If you would like to run the unit test against a live storage account, you will need to setup environment variables which will be used. These test will use these credentials to run live tests against Azure with the provided credentials. Note that you will be charged for storage usage. You need verify the clean up script did its job at the end of a test run. @@ -36,7 +36,7 @@ Unit tests can then be run from root directory using: npm test ``` -To run unit tests against a live storage account, please set environment variable to turn off Nock by: +To run unit tests against live storage accounts, please set environment variable to turn off Nock by: ```bash export NOCK_OFF=true @@ -46,12 +46,11 @@ and set up the following environment variables for storage account credentials b ```bash export AZURE_STORAGE_CONNECTION_STRING="valid storage connection string" +export AZURE_STORAGE_CONNECTION_STRING_PREMIUM_ACCOUNT="optional valid storage connection string for premium storage account" +export AZURE_STORAGE_CONNECTION_STRING_SSE_ENABLED_ACCOUNT="optional valid storage connection string for storage account with storage service encryption enabled" ``` -or -```bash -export AZURE_STORAGE_ACCOUNT="valid storage account name" -export AZURE_STORAGE_ACCESS_KEY="valid storage account key" -``` + +Note: `AZURE_STORAGE_CONNECTION_STRING_PREMIUM_ACCOUNT` and `AZURE_STORAGE_CONNECTION_STRING_SSE_ENABLED_ACCOUNT` are optional settings to enable testing suites related to premium storage account and storage service encryption, and only needed to be set when you are developing related features. ### Testing Features As you develop a feature, you'll need to write tests to ensure quality. Your changes should be covered by both unit tests. You should also run existing tests related to your change to address any unexpected breaks. diff --git a/test/services/blob/blobservice-tests.js b/test/services/blob/blobservice-tests.js index 1616a159..5b64a4b1 100644 --- a/test/services/blob/blobservice-tests.js +++ b/test/services/blob/blobservice-tests.js @@ -318,11 +318,11 @@ describe('BlobService', function () { assert.equal(uploadError, null); assert.ok(uploadResponse.isSuccessful); - blobService.getBlobToText(containerName, blobName, function (downloadErr, blobText, blob, downloadResponse) { + blobService.getBlobToText(containerName, blobName, function (downloadErr, content, blob, downloadResponse) { assert.equal(downloadErr, null); assert.ok(downloadResponse.isSuccessful); assert.ok(blob); - assert.equal(blobText, blobText); + assert.strictEqual(content, blobText); done(); }); @@ -337,11 +337,11 @@ describe('BlobService', function () { assert.equal(uploadError, null); assert.ok(uploadResponse.isSuccessful); - blobService.getBlobToText(containerName, blobName, function (downloadErr, blobText, blob, downloadResponse) { + blobService.getBlobToText(containerName, blobName, function (downloadErr, content, blob, downloadResponse) { assert.equal(downloadErr, null); assert.ok(downloadResponse.isSuccessful); assert.ok(blob); - assert.equal(blobText, blobText); + assert.strictEqual(content, blobText); done(); }); @@ -356,11 +356,11 @@ describe('BlobService', function () { assert.equal(uploadError, null); assert.ok(uploadResponse.isSuccessful); - blobService.getBlobToText(containerName, blobName, function (downloadErr, blobText, blob, downloadResponse) { + blobService.getBlobToText(containerName, blobName, function (downloadErr, content, blob, downloadResponse) { assert.equal(downloadErr, null); assert.ok(downloadResponse.isSuccessful); assert.ok(blob); - assert.equal(blobText, blobText); + assert.strictEqual(content, blobText); done(); }); @@ -375,11 +375,11 @@ describe('BlobService', function () { assert.equal(uploadError, null); assert.ok(uploadResponse.isSuccessful); - blobService.getBlobToText(containerName, blobName, function (downloadErr, blobText, blob, downloadResponse) { + blobService.getBlobToText(containerName, blobName, function (downloadErr, content, blob, downloadResponse) { assert.equal(downloadErr, null); assert.ok(downloadResponse.isSuccessful); assert.ok(blob); - assert.equal(blobText, blobText); + assert.equal(content, blobText); done(); }); @@ -656,7 +656,7 @@ describe('BlobService', function () { assert.equal(getErr, null); assert.notEqual(blob, null); - assert.strictEqual(blob.serverEncrypted, "false"); + assert.notEqual(blob.serverEncrypted, null); //Note the storage account for this test suite could have enabled or disabled SSE. if (blob) { assert.notEqual(blob.metadata, null); From c42fcc5e84a2c8b1c1dcafde85b6fb7459ca89c0 Mon Sep 17 00:00:00 2001 From: jiacfan Date: Thu, 17 Aug 2017 09:56:30 +0800 Subject: [PATCH 08/10] Improve API documentation. --- ChangeLog.md | 5 +++-- lib/services/blob/blobservice.core.js | 5 +++++ lib/services/file/fileservice.core.js | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index a37c238f..ccf33f2d 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -7,16 +7,17 @@ ALL * Updated storage service version to 2017-04-17. For more information, please see - https://docs.microsoft.com/en-us/rest/api/storageservices/versioning-for-the-azure-storage-services * Updated the dependency of the 'request' module to avoid security vulnerability: (https://snyk.io/test/npm/azure-storage). * Added `requestServerEncrypted` property to `ServiceResponse` which indicates if the contents of the request have been successfully encrypted. +* Improved API documentation. BLOB * PageBlobs: For Premium Accounts only, added support for getting and setting the tier on a page blob. The tier can also be set when creating or copying from an existing page blob. FILE * Added `serverEncryped` property to `FileResult` and `DirectoryResult` which indicates if the file data and application metadata are completely encrypted using the specified algorithm on the server. -* Fix a TypeScript issue that SharedAccessPermissions for FileUtilities is missing in type definition file. +* Fixed a TypeScript issue that SharedAccessPermissions for FileUtilities is missing in type definition file. TABLE -* Fix a typo in table query example for combineFilters function. +* Fixed a typo in table query example for combineFilters function. 2017.08 Version 2.2.2 diff --git a/lib/services/blob/blobservice.core.js b/lib/services/blob/blobservice.core.js index 35b42a83..6f9dced8 100644 --- a/lib/services/blob/blobservice.core.js +++ b/lib/services/blob/blobservice.core.js @@ -2453,6 +2453,7 @@ BlobService.prototype.createPageBlobFromStream = function (container, blob, stre /** * Provides a stream to write to a page blob. Assumes that the blob exists. * If it does not, please create the blob using createPageBlob before calling this method or use createWriteStreamNewPageBlob. +* Please note the `Stream` returned by this API should be used with piping. * * @this {BlobService} * @param {string} container The container name. @@ -2502,6 +2503,7 @@ BlobService.prototype.createWriteStreamToExistingPageBlob = function (container, /** * Provides a stream to write to a page blob. Creates the blob before writing data. If the blob already exists on the service, it will be overwritten. +* Please note the `Stream` returned by this API should be used with piping. * * @this {BlobService} * @param {string} container The container name. @@ -3090,6 +3092,7 @@ BlobService.prototype.createBlockBlobFromText = function (container, blob, text, /** * Provides a stream to write to a block blob. If the blob already exists on the service, it will be overwritten. * To avoid overwriting and instead throw an error if the blob exists, please pass in an accessConditions parameter in the options object. +* Please note the `Stream` returned by this API should be used with piping. * * @this {BlobService} * @param {string} container The container name. @@ -3622,6 +3625,7 @@ BlobService.prototype.createAppendBlobFromText = function (container, blob, text * To avoid overwriting and instead throw an error if the blob exists, please pass in an accessConditions parameter in the options object. * This API should be used strictly in a single writer scenario because the API internally uses the append-offset conditional header to avoid duplicate blocks. * If you are guaranteed to have a single writer scenario, please look at options.absorbConditionalErrorsOnRetry and see if setting this flag to true is acceptable for you. +* Please note the `Stream` returned by this API should be used with piping. * * @this {BlobService} * @param {string} container The container name. @@ -3667,6 +3671,7 @@ BlobService.prototype.createWriteStreamToNewAppendBlob = function (container, bl * If it does not, please create the blob using createAppendBlob before calling this method or use createWriteStreamToNewAppendBlob. * This API should be used strictly in a single writer scenario because the API internally uses the append-offset conditional header to avoid duplicate blocks. * If you are guaranteed to have a single writer scenario, please look at options.absorbConditionalErrorsOnRetry and see if setting this flag to true is acceptable for you. +* Please note the `Stream` returned by this API should be used with piping. * * @this {BlobService} * @param {string} container The container name. diff --git a/lib/services/file/fileservice.core.js b/lib/services/file/fileservice.core.js index d02f038d..d94052e7 100644 --- a/lib/services/file/fileservice.core.js +++ b/lib/services/file/fileservice.core.js @@ -2765,6 +2765,7 @@ FileService.prototype.createFileFromStream = function(share, directory, file, st /** * Provides a stream to write to a file. Assumes that the file exists. * If it does not, please create the file using createFile before calling this method or use createWriteStreamNewFile. +* Please note the `Stream` returned by this API should be used with piping. * * @this {FileService} * @param {string} share The share name. @@ -2834,6 +2835,7 @@ FileService.prototype.createWriteStreamToExistingFile = function (share, directo /** * Provides a stream to write to a file. Creates the file before writing data. +* Please note the `Stream` returned by this API should be used with piping. * * @this {FileService} * @param {string} share The share name. From 0d863194aeb3edb9e404005a26047e2bb1a58cfc Mon Sep 17 00:00:00 2001 From: Xiaoning Liu Date: Thu, 17 Aug 2017 11:01:55 +0800 Subject: [PATCH 09/10] Update ChangeLog.md for JavaScript Client Library 0.2.3-preview.9 --- browser/ChangeLog.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/browser/ChangeLog.md b/browser/ChangeLog.md index dd85425d..6562f3b5 100644 --- a/browser/ChangeLog.md +++ b/browser/ChangeLog.md @@ -1,5 +1,9 @@ Note: This is the change log file for Azure Storage JavaScript Client Library. +2017.08 Version 0.2.3-preview.9 + +* Generated browser compatible JavaScript files based on Microsoft Azure Storage SDK for Node.js 2.3.0. + 2017.08 Version 0.2.2-preview.8 * Generated browser compatible JavaScript files based on Microsoft Azure Storage SDK for Node.js 2.2.2. From bddba29b4ff881d3af70d22ddfe98e3b48821c48 Mon Sep 17 00:00:00 2001 From: jiacfan Date: Thu, 17 Aug 2017 15:58:23 +0800 Subject: [PATCH 10/10] Fix issue related to JsDoc behavior change. --- lib/common/services/storageserviceclient.js | 2 +- typings/azure-storage/azure-storage.d.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/common/services/storageserviceclient.js b/lib/common/services/storageserviceclient.js index 85870e2d..d6334bd5 100644 --- a/lib/common/services/storageserviceclient.js +++ b/lib/common/services/storageserviceclient.js @@ -1193,7 +1193,7 @@ StorageServiceClient._normalizeError = function (error, response) { return null; }; -/* +/** * Sets proxy object specified by caller. * * @param {object} proxy proxy to use for tunneling diff --git a/typings/azure-storage/azure-storage.d.ts b/typings/azure-storage/azure-storage.d.ts index 97a34c46..a53b3d9b 100644 --- a/typings/azure-storage/azure-storage.d.ts +++ b/typings/azure-storage/azure-storage.d.ts @@ -1650,6 +1650,7 @@ declare module azurestorage { /** * Provides a stream to write to a page blob. Assumes that the blob exists. * If it does not, please create the blob using createPageBlob before calling this method or use createWriteStreamNewPageBlob. + * Please note the `Stream` returned by this API should be used with piping. * * @this {BlobService} * @param {string} container The container name. @@ -1696,6 +1697,7 @@ declare module azurestorage { /** * Provides a stream to write to a page blob. Creates the blob before writing data. + * Please note the `Stream` returned by this API should be used with piping. * * @this {BlobService} * @param {string} container The container name. @@ -2067,6 +2069,7 @@ declare module azurestorage { /** * Provides a stream to write to a block blob. + * Please note the `Stream` returned by this API should be used with piping. * * @this {BlobService} * @param {string} container The container name. @@ -2453,6 +2456,7 @@ declare module azurestorage { * To avoid overwriting and instead throw an error if the blob exists, please pass in an accessConditions parameter in the options object. * This API should be used strictly in a single writer scenario because the API internally uses the append-offset conditional header to avoid duplicate blocks. * If you are guaranteed to have a single writer scenario, please look at options.absorbConditionalErrorsOnRetry and see if setting this flag to true is acceptable for you. + * Please note the `Stream` returned by this API should be used with piping. * * @this {BlobService} * @param {string} container The container name. @@ -2499,6 +2503,7 @@ declare module azurestorage { * If it does not, please create the blob using createAppendBlob before calling this method or use createWriteStreamToNewAppendBlob. * This API should be used strictly in a single writer scenario because the API internally uses the append-offset conditional header to avoid duplicate blocks. * If you are guaranteed to have a single writer scenario, please look at options.absorbConditionalErrorsOnRetry and see if setting this flag to true is acceptable for you. + * Please note the `Stream` returned by this API should be used with piping. * * @this {BlobService} * @param {string} container The container name. @@ -7169,6 +7174,7 @@ declare module azurestorage { /** * Provides a stream to write to a file. Assumes that the file exists. * If it does not, please create the file using createFile before calling this method or use createWriteStreamNewFile. + * Please note the `Stream` returned by this API should be used with piping. * * @this {FileService} * @param {string} share The share name. @@ -7211,6 +7217,7 @@ declare module azurestorage { /** * Provides a stream to write to a file. Creates the file before writing data. + * Please note the `Stream` returned by this API should be used with piping. * * @this {FileService} * @param {string} share The share name.