Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adjusting wrap client

  • Loading branch information...
commit 6932775301f2d819850a15f6525d9744a76f0b95 1 parent e43364a
@andrerod andrerod authored
View
32 lib/services/blob/blobservice.js
@@ -78,31 +78,31 @@ BlobService.incorrectEndByteOffsetErr = 'End byte offset must be a modulus of 51
* @param {object} [authenticationProvider] The authentication provider.
*/
function BlobService(storageAccountOrConnectionString, storageAccessKey, host, authenticationProvider) {
+ var storageServiceSettings;
if (storageAccountOrConnectionString && !storageAccessKey) {
// If namespaceOrConnectionString was passed and no accessKey was passed, assume connection string
- var storageServiceSettings = StorageServiceSettings.createFromConnectionString(storageAccountOrConnectionString);
- if (storageServiceSettings._name) {
- storageAccount = storageServiceSettings._name;
- }
-
- if (storageServiceSettings._key) {
- storageAccessKey = storageServiceSettings._key;
- }
-
- if (storageServiceSettings._blobEndpointUri) {
- host = storageServiceSettings._blobEndpointUri;
- }
- }
-
- if (!host) {
+ storageServiceSettings = StorageServiceSettings.createFromConnectionString(storageAccountOrConnectionString);
+ } else {
if (!(storageAccountOrConnectionString && storageAccessKey) && ServiceClient.isEmulated()) {
host = ServiceClient.DEVSTORE_BLOB_HOST;
} else {
host = ServiceClient.CLOUD_BLOB_HOST;
}
+
+ var settings = {
+ accountname: storageAccountOrConnectionString,
+ accountkey: storageAccessKey,
+ blobendpoint: host
+ };
+
+ storageServiceSettings = StorageServiceSettings.createFromSettings(settings);
}
- BlobService.super_.call(this, storageAccountOrConnectionString, storageAccessKey, host, authenticationProvider);
+ BlobService.super_.call(this,
+ storageServiceSettings._name,
+ storageServiceSettings._key,
+ storageServiceSettings._blobEndpointUri,
+ authenticationProvider);
if (!this.authenticationProvider) {
this.authenticationProvider = new SharedKey(this.storageAccount, this.storageAccessKey, this.usePathStyleUri);
View
32 lib/services/queue/queueservice.js
@@ -52,31 +52,31 @@ exports = module.exports = QueueService;
* @param {object} [authenticationProvider] The authentication provider.
*/
function QueueService(storageAccountOrConnectionString, storageAccessKey, host, authenticationProvider) {
+ var storageServiceSettings;
if (storageAccountOrConnectionString && !storageAccessKey) {
// If namespaceOrConnectionString was passed and no accessKey was passed, assume connection string
- var storageServiceSettings = StorageServiceSettings.createFromConnectionString(storageAccountOrConnectionString);
- if (storageServiceSettings._name) {
- storageAccount = storageServiceSettings._name;
- }
-
- if (storageServiceSettings._key) {
- storageAccessKey = storageServiceSettings._key;
- }
-
- if (storageServiceSettings._queueEndpointUri) {
- host = storageServiceSettings._queueEndpointUri;
- }
- }
-
- if (!host) {
+ storageServiceSettings = StorageServiceSettings.createFromConnectionString(storageAccountOrConnectionString);
+ } else {
if (!(storageAccountOrConnectionString && storageAccessKey) && ServiceClient.isEmulated()) {
host = ServiceClient.DEVSTORE_QUEUE_HOST;
} else {
host = ServiceClient.CLOUD_QUEUE_HOST;
}
+
+ var settings = {
+ accountname: storageAccountOrConnectionString,
+ accountkey: storageAccessKey,
+ queueendpoint: host
+ };
+
+ storageServiceSettings = StorageServiceSettings.createFromSettings(settings);
}
- QueueService.super_.call(this, storageAccountOrConnectionString, storageAccessKey, host, authenticationProvider);
+ QueueService.super_.call(this,
+ storageServiceSettings._name,
+ storageServiceSettings._key,
+ storageServiceSettings._blobEndpointUri,
+ authenticationProvider);
if (!this.authenticationProvider) {
this.authenticationProvider = new SharedKey(this.storageAccount, this.storageAccessKey, this.usePathStyleUri);
View
25 lib/services/serviceBus/wrapservice.js
@@ -35,25 +35,11 @@ exports = module.exports = WrapService;
/**
* Creates a new WrapService object.
*
-* @param {string} acsNamespace The access control namespace.
-* @param {string} issuer The service bus issuer.
-* @param {string} accessKey The service bus issuer password.
-* @param {string} host The host for the service.
+* @param {string} acsHost The access control host.
+* @param {string} [issuer] The service bus issuer.
+* @param {string} [accessKey] The service bus issuer password.
*/
-function WrapService(acsNamespace, issuer, accessKey, host) {
- if (!host) {
- host = ServiceClient.CLOUD_ACCESS_CONTROL_HOST;
- }
-
- this.acsNamespace = acsNamespace;
- if (!this.acsNamespace) {
- this.acsNamespace = process.env[ServiceClient.EnvironmentVariables.AZURE_WRAP_NAMESPACE];
-
- if (!this.acsNamespace) {
- this.acsNamespace = process.env[ServiceClient.EnvironmentVariables.AZURE_SERVICEBUS_NAMESPACE] + ServiceClient.DEFAULT_WRAP_NAMESPACE_SUFFIX;
- }
- }
-
+function WrapService(acsHost, issuer, accessKey) {
this.issuer = issuer;
if (!this.issuer) {
this.issuer = process.env[ServiceClient.EnvironmentVariables.AZURE_SERVICEBUS_ISSUER];
@@ -69,9 +55,6 @@ function WrapService(acsNamespace, issuer, accessKey, host) {
}
WrapService.super_.call(this, host);
-
- this.protocol = 'https://';
- this.port = 443;
}
util.inherits(WrapService, ServiceClient);
View
34 lib/services/table/tableservice.js
@@ -62,33 +62,31 @@ TableService.incorrectPartitionErr = 'PartitionKey and RowKey must be specified
* @param {object} [authenticationProvider] The authentication provider.
*/
function TableService(storageAccountOrConnectionString, storageAccessKey, host, authenticationProvider) {
- var storageAccount = storageAccountOrConnectionString;
-
+ var storageServiceSettings;
if (storageAccountOrConnectionString && !storageAccessKey) {
// If namespaceOrConnectionString was passed and no accessKey was passed, assume connection string
- var storageServiceSettings = StorageServiceSettings.createFromConnectionString(storageAccountOrConnectionString);
- if (storageServiceSettings._name) {
- storageAccount = storageServiceSettings._name;
- }
-
- if (storageServiceSettings._key) {
- storageAccessKey = storageServiceSettings._key;
- }
-
- if (storageServiceSettings._tableEndpointUri) {
- host = storageServiceSettings._tableEndpointUri;
- }
- }
-
- if (!host) {
+ storageServiceSettings = StorageServiceSettings.createFromConnectionString(storageAccountOrConnectionString);
+ } else {
if (!(storageAccountOrConnectionString && storageAccessKey) && ServiceClient.isEmulated()) {
host = ServiceClient.DEVSTORE_TABLE_HOST;
} else {
host = ServiceClient.CLOUD_TABLE_HOST;
}
+
+ var settings = {
+ accountname: storageAccountOrConnectionString,
+ accountkey: storageAccessKey,
+ tableendpoint: host
+ };
+
+ storageServiceSettings = StorageServiceSettings.createFromSettings(settings);
}
- TableService.super_.call(this, storageAccountOrConnectionString, storageAccessKey, host, authenticationProvider);
+ TableService.super_.call(this,
+ storageServiceSettings._name,
+ storageServiceSettings._key,
+ storageServiceSettings._tableEndpointUri,
+ authenticationProvider);
if (!this.authenticationProvider) {
this.authenticationProvider = new SharedKeyTable(this.storageAccount, this.storageAccessKey, this.usePathStyleUri);
View
3  test/services/core/servicebussettings-tests.js
@@ -23,7 +23,6 @@ var ConnectionStringKeys = Constants.ConnectionStringKeys;
var ServiceBusSettings = azure.ServiceBusSettings;
suite('servicebussettings-tests', function () {
- /*
test('testCreateFromConnectionStringWithServiceBusAutomaticCase', function () {
// Setup
var expectedNamespace = 'mynamespace';
@@ -64,7 +63,7 @@ suite('servicebussettings-tests', function () {
ServiceBusSettings.createFromConnectionString(connectionString);
}).should.throw('Invalid connection string setting key ' + invalidKey.toLowerCase());
});
-*/
+
test('testCreateFromConnectionStringWithCaseInvesitive', function () {
// Setup
var expectedNamespace = 'mynamespace';
View
36 test/testlist.txt
@@ -1,2 +1,36 @@
+cli/commands/generate-psm1-utils-test.js
+serviceruntime/roleenvironment-tests.js
+serviceruntime/runtimeversionmanager-tests.js
+serviceruntime/runtimeversionprotocolclient-tests.js
+services/blob/blobservice-tests.js
+services/blob/sharedaccesssignature-tests.js
+services/blob/sharedkey-tests.js
+services/blob/sharedkeylite-tests.js
+services/blob/filters-tests.js
+services/core/connectionstringparser-tests.js
+services/core/serviceclient-tests.js
+services/core/exponentialretrypolicyfilter-tests.js
+services/core/linearretrypolicyfilter-tests.js
+services/core/servicesettings-tests.js
+services/core/servicebussettings-tests.js
+services/core/servicemanagementsettings-tests.js
+services/core/storageservicesettings-tests.js
+services/queue/queueservice-tests.js
+services/table/batchserviceclient-tests.js
+services/table/sharedkeytable-tests.js
+services/table/sharedkeylitetable-tests.js
services/serviceBus/servicebusservice-tests.js
-services/core/servicebussettings-tests.js
+services/serviceBus/wrapservice-tests.js
+services/serviceBus/wraptokenmanager-tests.js
+services/table/tablequery-tests.js
+services/table/tableservice-batch-tests.js
+services/table/tableservice-tablequery-tests.js
+services/table/tableservice-tests.js
+util/atomhandler-tests.js
+util/iso8061date-tests.js
+util/util-tests.js
+util/validate-tests.js
+util/certificates/der.decoder-tests.js
+util/certificates/der.decoder.pfx.root-tests.js
+util/certificates/pkcs.filedecoder-tests.js
+azure-tests.js
Please sign in to comment.
Something went wrong with that request. Please try again.