Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
//
var assert = require('assert');
var qs = require('querystring');
// Test includes
var testutil = require('../../../util/util');
// Lib includes
var common = require('azure-common');
var storage = require('azure-storage-legacy');
var WebResource = common.WebResource;
var SharedAccessSignature = storage.SharedAccessSignature;
var Constants = common.Constants;
var ServiceClientConstants = common.ServiceClientConstants;
var BlobConstants = Constants.BlobConstants;
var QueryStringConstants = Constants.QueryStringConstants;
suite('sharedaccesssignature-tests', function () {
test('GenerateSignatureContainer', function (done) {
var credentials = new SharedAccessSignature(ServiceClientConstants.DEVSTORE_STORAGE_ACCOUNT, ServiceClientConstants.DEVSTORE_STORAGE_ACCESS_KEY);
var sharedAccessPolicy = {
Id: 'YWJjZGVmZw==',
AccessPolicy: {
Permissions: BlobConstants.SharedAccessPermissions.READ,
Start: '2011-10-11T00%3A00%3A00',
Expiry: '2011-10-12T00%3A00%3A00'
}
};
// 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('../../../util/util');
// Lib includes
var common = require('azure-common');
var SharedKeyLiteTable = require('azure-storage-legacy').SharedKeyLiteTable;
var WebResource = common.WebResource;
var ServiceClientConstants = common.ServiceClientConstants;
var Constants = common.Constants;
var HeaderConstants = Constants.HeaderConstants;
var QueryStringConstants = Constants.QueryStringConstants;
var sharedkey;
suite('sharedkeylitetable-tests', function () {
setup(function (done) {
sharedkey = new SharedKeyLiteTable(ServiceClientConstants.DEVSTORE_STORAGE_ACCOUNT, ServiceClientConstants.DEVSTORE_STORAGE_ACCESS_KEY, false);
done();
});
teardown(function (done) {
// clean up
done();
// Lib includes
var common = require('azure-common');
var storage = testutil.libRequire('services/legacyStorage');
var azureutil = common.util;
var azure = testutil.libRequire('azure');
var WebResource = common.WebResource;
var SharedAccessSignature = storage.SharedAccessSignature;
var BlobService = storage.BlobService;
var ServiceClient = common.ServiceClient;
var ExponentialRetryPolicyFilter = common.ExponentialRetryPolicyFilter;
var Constants = common.Constants;
var BlobConstants = Constants.BlobConstants;
var HttpConstants = Constants.HttpConstants;
var ServiceClientConstants = common.ServiceClientConstants;
var QueryStringConstants = Constants.QueryStringConstants;
var containerNames = [];
var containerNamesPrefix = 'cont';
var blobNames = [];
var blobNamesPrefix = 'blob';
var testPrefix = 'blobservice-tests';
var blobService;
var suiteUtil;
describe('BlobService', function () {
before(function (done) {
blobService = storage.createBlobService()
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
var assert = require('assert');
// Test includes
var testutil = require('../../../util/util');
// Lib includes
var common = require('azure-common');
var storage = require('azure-storage-legacy');
var WebResource = common.WebResource;
var SharedKey = storage.SharedKey;
var ServiceClientConstants = common.ServiceClientConstants;
var Constants = common.Constants;
var QueryStringConstants = Constants.QueryStringConstants;
var HeaderConstants = Constants.HeaderConstants;
var sharedkey;
suite('sharedkey-tests', function () {
setup(function (done) {
sharedkey = new SharedKey(ServiceClientConstants.DEVSTORE_STORAGE_ACCOUNT, ServiceClientConstants.DEVSTORE_STORAGE_ACCESS_KEY, false);
done();
});
teardown(function (done) {
// clean up
done();
//
var assert = require('assert');
// Test includes
var testutil = require('../../util/util');
var queuetestutil = require('../../framework/queue-test-utils');
// Lib includes
var azure = testutil.libRequire('azure');
var common = require('azure-common');
var storage = require('azure-storage-legacy');
var azureutil = common.util;
var Constants = common.Constants;
var ServiceClientConstants = common.ServiceClientConstants;
var HttpConstants = Constants.HttpConstants;
var queueService;
var queueNames = [];
var queueNamesPrefix = 'queue';
var testPrefix = 'queueservice-tests';
var tableService;
var suiteUtil;
suite('queueservice-tests', function () {
suiteSetup(function (done) {
queueService = storage.createQueueService()
.withFilter(new common.ExponentialRetryPolicyFilter());
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Module dependencies.
var _ = require('underscore');
var util = require('util');
var url = require('url');
var azureCommon = require('azure-common');
var ServiceBusServiceClient = require('./servicebusserviceclient');
var WebResource = azureCommon.WebResource;
var Constants = azureCommon.Constants;
var ServiceClientConstants = azureCommon.ServiceClientConstants;
var QueryStringConstants = Constants.QueryStringConstants;
var HeaderConstants = Constants.HeaderConstants;
var ServiceSettings = azureCommon.ServiceSettings;
var ServiceBusSettings = azureCommon.ServiceBusSettings;
/**
* Creates a new ServiceBusServiceBase object.
*
* @constructor
* @augments {ServiceClient}
*
* @param {string} [configOrNamespaceOrConnectionStringOrSettings] The sdk configuraiton, service bus namespace, the connection string, or service settings.
* @param {string} [accessKey] The password. Only necessary if no connection string passed.
* @param {string} [issuer] The issuer.
* @param {string} [acsNamespace] The acs namespace. Usually the same as the sb namespace with "-sb" suffix.
// 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 util = require('util');
var url = require('url');
var _ = require('underscore');
var SqlServiceClient = require('./sqlserviceclient');
var azureCommon = require('azure-common');
var WebResource = azureCommon.WebResource;
var ServiceClientConstants = azureCommon.ServiceClientConstants;
var OdataHandler = azureCommon.OdataHandler;
var databaseResult = require('./models/databaseresult');
var Constants = azureCommon.Constants;
var HeaderConstants = Constants.HeaderConstants;
var SqlAzureConstants = Constants.SqlAzureConstants;
/**
* Validates a callback function.
* @ignore
*
* @param {string} callback The callback function.
* @return {undefined}
*/
function validateCallback(callback) {
// 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 util = require('util');
var url = require('url');
var azureCommon = require('azure-common');
var ServiceClient = azureCommon.ServiceClient;
var WebResource = azureCommon.WebResource;
var Constants = azureCommon.Constants;
var ServiceClientConstants = azureCommon.ServiceClientConstants;
var HeaderConstants = Constants.HeaderConstants;
var acsTokenResult = require('./models/acstokenresult');
/**
* Creates a new WrapService object.
*
* @param {string} acsHost The access control host.
* @param {string} [issuer] The service bus issuer.
* @param {string} [accessKey] The service bus issuer password.
*/
function WrapService(acsHost, issuer, accessKey) {
if (!acsHost) {
var acsNamespace = process.env[ServiceClientConstants.EnvironmentVariables.AZURE_WRAP_NAMESPACE];
if (!acsNamespace) {
acsNamespace = process.env[ServiceClientConstants.EnvironmentVariables.AZURE_SERVICEBUS_NAMESPACE] + ServiceClientConstants.DEFAULT_WRAP_NAMESPACE_SUFFIX;
*/
exports.createCertificateCloudCredentials = azureCommon.createCertificateCloudCredentials;
/**
* Creates a new BasicAuthenticationCloudCredentials object.
* Either a pair of cert / key values need to be pass or a pem file location.
* @method
* @param {string} credentials.username The username.
* @param {string} credentials.password The password.
* @return {BasicAuthenticationCloudCredentials}
*/
exports.createBasicAuthenticationCloudCredentials = azureWebSite.createBasicAuthenticationCloudCredentials;
exports.Constants = azureCommon.Constants;
exports.ServiceClient = azureCommon.ServiceClient;
exports.ServiceClientConstants = azureCommon.ServiceClientConstants;
exports.ConnectionStringParser = azureCommon.ConnectionStringParser;
exports.Logger = azureCommon.Logger;
exports.WebResource = azureCommon.WebResource;
exports.Validate = azureCommon.validate;
exports.date = azureCommon.date;
exports.ServiceSettings = azureCommon.ServiceSettings;
exports.ServiceBusSettings = azureCommon.ServiceBusSettings;
exports.ServiceManagementSettings = azureCommon.ServiceManagementSettings;
exports.StorageServiceSettings = azureCommon.StorageServiceSettings;
// Credentials
exports.CertificateCloudCredentials = azureCommon.CertificateCloudCredentials;
exports.TokenCloudCredentials = azureCommon.TokenCloudCredentials;
exports.AnonymousCloudCredentials = azureCommon.AnonymousCloudCredentials;
exports.SharedAccessSignature = storage.SharedAccessSignature;
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Module dependencies.
var _ = require('underscore');
var util = require('util');
var url = require('url');
var azureCommon = require('azure-common');
var ServiceBusServiceClient = require('./servicebusserviceclient');
var WebResource = azureCommon.WebResource;
var Constants = azureCommon.Constants;
var ServiceClientConstants = azureCommon.ServiceClientConstants;
var QueryStringConstants = Constants.QueryStringConstants;
var HeaderConstants = Constants.HeaderConstants;
var ServiceSettings = azureCommon.ServiceSettings;
var ServiceBusSettings = azureCommon.ServiceBusSettings;
/**
* Creates a new ServiceBusServiceBase object.
*
* @constructor
* @augments {ServiceClient}
*
* @param {string} [configOrNamespaceOrConnectionStringOrSettings] The sdk configuraiton, service bus namespace, the connection string, or service settings.
* @param {string} [accessKey] The password. Only necessary if no connection string passed.
* @param {string} [issuer] The issuer.
* @param {string} [acsNamespace] The acs namespace. Usually the same as the sb namespace with "-sb" suffix.