Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// 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.
//
// Module dependencies.
var qs = require('querystring');
var azureCommon = require('azure-common');
var azureutil = azureCommon.util;
var HmacSha256Sign = azureCommon.HmacSha256Sign;
var Constants = azureCommon.Constants;
var BlobConstants = Constants.BlobConstants;
var QueryStringConstants = Constants.QueryStringConstants;
var SAS_VERSION = '2012-02-12';
/**
* Creates a new SharedAccessSignature object.
*
* @constructor
* @param {string} storageAccount The storage account.
* @param {string} storageAccessKey The storage account's access key.
* @param {array} permissionSet An array of URL's for which there is a permission defined.
*/
function SharedAccessSignature(storageAccount, storageAccessKey, permissionSet) {
// 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.
//
// Module dependencies.
var _ = require('underscore');
var azureCommon = require('azure-common');
var azureutil = azureCommon.util;
var HmacSha256Sign = azureCommon.HmacSha256Sign;
var Constants = azureCommon.Constants;
var HeaderConstants = Constants.HeaderConstants;
var QueryStringConstants = Constants.QueryStringConstants;
/**
* Creates a new SharedKey object.
*
* @constructor
* @param {string} storageAccount The storage account.
* @param {string} storageAccessKey The storage account's access key.
* @param {bool} usePathStyleUri Boolean value indicating if the path, or the hostname, should include the storage account.
*/
function SharedKeyLite(storageAccount, storageAccessKey, usePathStyleUri) {
this.storageAccount = storageAccount;
this.storageAccessKey = storageAccessKey;
this.usePathStyleUri = usePathStyleUri;
//
// 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.
//
// Module dependencies.
var _ = require('underscore');
var azureCommon = require('azure-common');
var azureutil = azureCommon.util;
var HeaderConstants = azureCommon.Constants.HeaderConstants;
var HmacSha256Sign = azureCommon.HmacSha256Sign;
/**
* Creates a new SharedKey object.
*
* @constructor
* @param {string} storageAccount The storage account.
* @param {string} storageAccessKey The storage account's access key.
* @param {bool} usePathStyleUri Boolean value indicating if the path, or the hostname, should include the storage account.
*/
function SharedKey(storageAccount, storageAccessKey, usePathStyleUri) {
this.storageAccount = storageAccount;
this.storageAccessKey = storageAccessKey;
this.usePathStyleUri = usePathStyleUri;
this.signer = new HmacSha256Sign(storageAccessKey);
}
// 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 util = require('util');
var crypto = require('crypto');
var azureCommon = require('azure-common');
var date = azureCommon.date;
var azureutil = azureCommon.util;
var HmacSha256Sign = azureCommon.HmacSha256Sign;
var Constants = azureCommon.Constants;
var HeaderConstants = Constants.HeaderConstants;
/**
* Creates a new SharedAccessSignature object.
*
* @constructor
* @param {string} keyName The shared access signature key name.
* @param {array} keyValue The shared access signature key value.
*/
function SharedAccessSignature(keyName, keyValue) {
this.keyName = keyName;
this.keyValue = keyValue;
this.signer = new HmacSha256Sign(keyValue);
}
// 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.
//
// Module dependencies.
var azureCommon = require('azure-common');
var azureutil = azureCommon.util;
var HmacSha256Sign = azureCommon.HmacSha256Sign;
var Constants = azureCommon.Constants;
var HeaderConstants = Constants.HeaderConstants;
var QueryStringConstants = Constants.QueryStringConstants;
/**
* Creates a new SharedKeyTable object.
*
* @constructor
* @param {string} storageAccount The storage account.
* @param {string} storageAccessKey The storage account's access key.
* @param {bool} usePathStyleUri Boolean value indicating if the path, or the hostname, should include the storage account.
*/
function SharedKeyTable(storageAccount, storageAccessKey, usePathStyleUri) {
this.storageAccount = storageAccount;
this.storageAccessKey = storageAccessKey;
this.usePathStyleUri = usePathStyleUri;
// 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.
//
// Module dependencies.
var azureCommon = require('azure-common');
var azureutil = azureCommon.util;
var HmacSha256Sign = azureCommon.HmacSha256Sign;
var Constants = azureCommon.Constants;
var HeaderConstants = Constants.HeaderConstants;
var QueryStringConstants = Constants.QueryStringConstants;
/**
* Creates a new SharedKeyLiteTable object.
*
* @constructor
* @param {string} storageAccount The storage account.
* @param {string} storageAccessKey The storage account's access key.
* @param {bool} usePathStyleUri Boolean value indicating if the path, or the hostname, should include the storage account.
*/
function SharedKeyLiteTable(storageAccount, storageAccessKey, usePathStyleUri) {
this.storageAccount = storageAccount;
this.storageAccessKey = storageAccessKey;
this.usePathStyleUri = usePathStyleUri;