Release 0.6.7 #448

Merged
merged 264 commits into from Nov 3, 2012
Commits
Jump to file or symbol
Failed to load files and symbols.
+5,502 −860
Diff settings

Always

Just for now

View
@@ -1,3 +1,9 @@
+2012.10.15 Version 0.6.7
+ * Adding connection strings support for storage and service bus
+ * Fixing issue with EMULATED and explicit variables making the later more relevant
+ * Adding Github support
+ * Adding website application settings support
+
2012.10.12 Version 0.6.6
* Using fixed version of commander.js to avoid bug in commander.js 1.0.5
@@ -33,7 +39,7 @@
* Multiple Bugfixes
2011.12.14 Version 0.5.1
- * Multiple bug fixes.
+ * Multiple bug fixes
2011.12.09 Version 0.5.0
* Initial Release
@@ -31,7 +31,7 @@ var helpers = require('./helpers.js');
var app = module.exports = express.createServer();
// Global request options, set the retryPolicy
-var blobClient = azure.createBlobService(azure.ServiceClient.DEVSTORE_STORAGE_ACCOUNT, azure.ServiceClient.DEVSTORE_STORAGE_ACCESS_KEY, azure.ServiceClient.DEVSTORE_BLOB_HOST).withFilter(new azure.ExponentialRetryPolicyFilter());
+var blobClient = azure.createBlobService('UseDevelopmentStorage=true').withFilter(new azure.ExponentialRetryPolicyFilter());
var containerName = 'webpi';
//Configuration
View
@@ -33,7 +33,7 @@ var tableName = 'posts';
var partition = 'part1';
Blog = function () {
- this.tableClient = azure.createTableService(ServiceClient.DEVSTORE_STORAGE_ACCOUNT, ServiceClient.DEVSTORE_STORAGE_ACCESS_KEY, ServiceClient.DEVSTORE_TABLE_HOST);
+ this.tableClient = azure.createTableService('UseDevelopmentStorage=true');
};
Blog.prototype.findAll = function (callback) {
@@ -1,7 +1,7 @@
body {
font-family: Tahoma, "Helvetica Neue", Arial, Helvetica, sans-serif;
font-size: 13px;
- text-stroke: 1px rgba(255,255,255,0.10);
+ text-stroke: 1px rgba(255,255,255,0.1);
color: #555;
background-color: #f3f4f5;
}
@@ -2,11 +2,12 @@
"name": "geophoto"
, "version": "0.0.1"
, "dependencies": {
- "azure": ">= 0.5.1"
- , "express": "2.5.1"
+ "express": "2.5.1"
, "ejs": ">= 0.0.1"
, "socket.io": "0.8.7"
, "node-uuid": ">= 1.3.3"
, "nconf": ">= 0.5.1"
+ , "uglify-js": ">= 1.3.3"
+ , "azure": ">= 0.5.1"
}
}
@@ -19,8 +19,8 @@ if (!fs.existsSync) {
}
var azure;
-if (fs.existsSync('./../../lib/azure.js')) {
- azure = require('./../../lib/azure');
+if (fs.existsSync('./../../../lib/azure.js')) {
+ azure = require('./../../../lib/azure');
} else {
azure = require('azure');
}
@@ -14,11 +14,11 @@
<script type="text/javascript" src="socket.io/socket.io.js"></script>
<script type="text/javascript">
- var bingMapsCredentials = '<%= bingMapsCredentials %>';
+ var bingMapsCredentials = '<% if (locals.bingMapsCredentials) { %><%= bingMapsCredentials %><% } %>';
var initialPushpins = [
- <% pushpins.forEach(function(pushpin) { %>
+ <% if (locals.pushpins) { pushpins.forEach(function(pushpin) { %>
{ title: '<%= pushpin.title %>', description: '<%= pushpin.description %>', latitude: '<%= pushpin.latitude %>', longitude: '<%= pushpin.longitude %>', RowKey: '<%= pushpin.RowKey %>', PartitionKey: '<%= pushpin.PartitionKey %>', imageUrl: '<%= pushpin.imageUrl %>' },
- <% }) %>
+ <% }) } %>
];
</script>
@@ -11,8 +11,8 @@ var express = require('express')
var app = module.exports = express.createServer();
-var tableClient = azure.createTableService(ServiceClient.DEVSTORE_STORAGE_ACCOUNT, ServiceClient.DEVSTORE_STORAGE_ACCESS_KEY, ServiceClient.DEVSTORE_TABLE_HOST);
-var blobClient = azure.createBlobService(azure.ServiceClient.DEVSTORE_STORAGE_ACCOUNT, azure.ServiceClient.DEVSTORE_STORAGE_ACCESS_KEY, azure.ServiceClient.DEVSTORE_BLOB_HOST).withFilter(new azure.ExponentialRetryPolicyFilter());
+var tableClient = azure.createTableService('UseDevelopmentStorage=true');
+var blobClient = azure.createBlobService('UseDevelopmentStorage=true').withFilter(new azure.ExponentialRetryPolicyFilter());
// Create table and blob
tableClient.createTableIfNotExists('events', function(error) {
@@ -32,7 +32,7 @@ var Home = require('./home');
var ServiceClient = azure.ServiceClient;
var app = module.exports = express.createServer();
-var client = azure.createTableService(ServiceClient.DEVSTORE_STORAGE_ACCOUNT, ServiceClient.DEVSTORE_STORAGE_ACCESS_KEY, ServiceClient.DEVSTORE_TABLE_HOST);
+var client = azure.createTableService('UseDevelopmentStorage=true');
// table creation
client.createTableIfNotExists("tasks", function (res, created) {
View
@@ -26,13 +26,13 @@ exports.TableService = TableService;
* Creates a new TableService object.
* If no storageaccount or storageaccesskey are provided, the AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY environment variables will be used.
*
-* @param {string} [storageAccount] The storage account.
-* @param {string} [storageAccessKey] The storage access key.
-* @param {string} [host] The host address.
-* @param {object} [authenticationProvider] The authentication provider.
+* @param {string} [storageAccountOrConnectionString] The storage account or the connection string.
+* @param {string} [storageAccessKey] The storage access key.
+* @param {string} [host] The host address.
+* @param {object} [authenticationProvider] The authentication provider.
*/
-exports.createTableService = function (storageAccount, storageAccessKey, host, authenticationProvider) {
- return new TableService(storageAccount, storageAccessKey, host, authenticationProvider);
+exports.createTableService = function (storageAccountOrConnectionString, storageAccessKey, host, authenticationProvider) {
+ return new TableService(storageAccountOrConnectionString, storageAccessKey, host, authenticationProvider);
};
/**
@@ -46,13 +46,13 @@ exports.BlobService = BlobService;
* Creates a new BlobService object.
* If no storageaccount or storageaccesskey are provided, the AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY environment variables will be used.
*
-* @param {string} [storageAccount] The storage account.
-* @param {string} [storageAccessKey] The storage access key.
-* @param {string} [host] The host address.
-* @param {object} [authenticationProvider] The authentication provider.
+* @param {string} [storageAccountOrConnectionString] The storage account or the connection string.
+* @param {string} [storageAccessKey] The storage access key.
+* @param {string} [host] The host address.
+* @param {object} [authenticationProvider] The authentication provider.
*/
-exports.createBlobService = function (storageAccount, storageAccessKey, host, authenticationProvider) {
- return new BlobService(storageAccount, storageAccessKey, host, authenticationProvider);
+exports.createBlobService = function (storageAccountOrConnectionString, storageAccessKey, host, authenticationProvider) {
+ return new BlobService(storageAccountOrConnectionString, storageAccessKey, host, authenticationProvider);
};
/**
@@ -67,13 +67,13 @@ exports.QueueService = QueueService;
* If no storageAccount or storageAccessKey are provided, the AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY
* environment variables will be used.
*
-* @param {string} [storageAccount] The storage account.
-* @param {string} [storageAccessKey] The storage access key.
-* @param {string} [host] The host address.
-* @param {object} [authenticationProvider] The authentication provider.
+* @param {string} [storageAccountOrConnectionString] The storage account or the connection string.
+* @param {string} [storageAccessKey] The storage access key.
+* @param {string} [host] The host address.
+* @param {object} [authenticationProvider] The authentication provider.
*/
-exports.createQueueService = function (storageAccount, storageAccessKey, host, authenticationProvider) {
- return new QueueService(storageAccount, storageAccessKey, host, authenticationProvider);
+exports.createQueueService = function (storageAccountOrConnectionString, storageAccessKey, host, authenticationProvider) {
+ return new QueueService(storageAccountOrConnectionString, storageAccessKey, host, authenticationProvider);
};
/**
@@ -86,15 +86,15 @@ exports.ServiceBusService = ServiceBusService;
/**
* Creates a new ServiceBusService object.
*
-* @param {string} [namespace] The service bus namespace.
-* @param {string} [accessKey] The password.
-* @param {string} [issuer] The issuer.
-* @param {string} [acsNamespace] The acs namespace. Usually the same as the sb namespace with "-sb" suffix.
-* @param {string} [host] The host address.
-* @param {object} [authenticationProvider] The authentication provider.
+* @param {string} [namespaceOrConnectionString] The service bus namespace.
+* @param {string} [accessKey] The password.
+* @param {string} [issuer] The issuer.
+* @param {string} [acsNamespace] The acs namespace. Usually the same as the sb namespace with "-sb" suffix.
+* @param {string} [host] The host address.
+* @param {object} [authenticationProvider] The authentication provider.
*/
-exports.createServiceBusService = function (namespace, accessKey, issuer, acsNamespace, host, authenticationProvider) {
- return new ServiceBusService(namespace, accessKey, issuer, acsNamespace, host, authenticationProvider);
+exports.createServiceBusService = function (namespaceOrConnectionString, accessKey, issuer, acsNamespace, host, authenticationProvider) {
+ return new ServiceBusService(namespaceOrConnectionString, accessKey, issuer, acsNamespace, host, authenticationProvider);
};
/**
@@ -149,6 +149,12 @@ exports.SharedKeyTable = require('./services/table/sharedkeytable');
exports.SharedKeyLiteTable = require('./services/table/sharedkeylitetable');
exports.ISO8061Date = require('./util/iso8061date');
exports.Logger = require('./diagnostics/logger');
+exports.ConnectionStringParser = require('./services/core/connectionstringparser');
+exports.ServiceSettings = require('./services/core/servicesettings');
+exports.StorageServiceSettings = require('./services/core/storageservicesettings');
+exports.ServiceBusSettings = require('./services/core/servicebussettings');
+exports.ServiceManagementSettings = require('./services/core/servicemanagementsettings');
+exports.Validate = require('./util/validate');
/*
* Convenience functions.
View
@@ -344,66 +344,71 @@ commander.Command.prototype.whiteListPowershell = function (whitelist) {
return this;
};
-// Allow cli.password to accept empty passwords
-commander.Command.prototype.password = function (str, mask, fn) {
+commander.Command.prototype.passwordOnce = function (currentStr, mask, callback) {
+ var self = this;
+ var buf = '';
+
// default mask
if ('function' === typeof mask) {
- fn = mask;
+ callback = mask;
mask = '';
}
- var getPassword = function (currentStr, callback) {
- var self = this;
- var buf = '';
+ if (!process.stdin.setRawMode) {
+ process.stdin.setRawMode = tty.setRawMode;
+ }
- if (!process.stdin.setRawMode) {
- process.stdin.setRawMode = tty.setRawMode;
+ process.stdin.resume();
+ process.stdin.setRawMode(true);
+ fs.writeSync(istty1 ? 1 : 2, currentStr);
+ process.stdin.on('data', function(char) {
+ // Exit on Ctrl+C keypress
+ char = char.toString();
+ if (char === '\003') {
+ console.log('%s', buf);
+ process.exit();
}
- process.stdin.resume();
- process.stdin.setRawMode(true);
- fs.writeSync(istty1 ? 1 : 2, currentStr);
- process.stdin.on('data', function(char) {
- // Exit on Ctrl+C keypress
- char = char.toString();
- if (char === '\003') {
- console.log('%s', buf);
- process.exit();
- }
+ // Return password in the buffer on enter key press
+ if (char === '\015') {
+ process.stdin.removeAllListeners('data');
+ process.stdout.write('\n');
+ process.stdin.setRawMode(false);
+ process.stdin.pause();
- // Return password in the buffer on enter key press
- if (char === '\015') {
- process.stdin.removeAllListeners('data');
- process.stdout.write('\n');
- process.stdin.setRawMode(false);
- callback(buf);
- return;
- }
-
- // Backspace handling
- // Windows usually sends '\b' (^H) while Linux sends '\x7f'
- if (char === '\b' || char === '\177') {
- if (buf) {
- buf = buf.slice(0, -1);
- for (var j = 0; j < mask.length; ++j) {
- process.stdout.write('\b \b'); // space the last char out
- }
+ return callback(buf);
+ }
+
+ // Backspace handling
+ // Windows usually sends '\b' (^H) while Linux sends '\x7f'
+ if (char === '\b' || char === '\177') {
+ if (buf) {
+ buf = buf.slice(0, -1);
+ for (var j = 0; j < mask.length; ++j) {
+ process.stdout.write('\b \b'); // space the last char out
}
- return;
- }
- char = char.split('\015')[0]; // only use the first line if many (for paste)
- for(var i = 0; i < char.length; ++i) {
- process.stdout.write(mask); // output several chars (for paste)
}
- buf += char;
- }).resume();
- };
+ return;
+ }
+
+ char = char.split('\015')[0]; // only use the first line if many (for paste)
+ for(var i = 0; i < char.length; ++i) {
+ process.stdout.write(mask); // output several chars (for paste)
+ }
+
+ buf += char;
+ });
+};
+
+// Allow cli.password to accept empty passwords
+commander.Command.prototype.password = function (str, mask, fn) {
+ var self = this;
// Prompt first time
- getPassword(str, function (pass) {
+ self.passwordOnce(str, mask, function (pass) {
// Prompt for confirmation
- getPassword('Confirm password: ', function (pass2) {
+ self.passwordOnce('Confirm password: ', mask, function (pass2) {
if (pass === pass2) {
fn (pass);
} else {
@@ -413,7 +418,6 @@ commander.Command.prototype.password = function (str, mask, fn) {
});
};
-
commander.Command.prototype.execute = function (fn) {
var self = this;
return self.action(function () {
@@ -39,9 +39,10 @@ exports.init = function (cli) {
account.command('download')
.whiteListPowershell()
.description('Launch a browser to download your publishsettings file')
+ .option('-r, --realm <realm>', 'Specify organization used for login')
.execute(function (options, callback) {
try {
- var url = utils.getPublishingProfileUrl();
+ var url = utils.getPublishingProfileUrl(options.realm);
common.launchBrowser(url);
log.help('Save the downloaded file, then execute the command');
log.help(' account import <file>');
@@ -203,7 +204,7 @@ exports.init = function (cli) {
log.info('Setting default subscription to:', subs[0]['@'].Name);
log.info('Use "azure account set" to change to a different one.')
var config = account.readConfig();
- config.subscription = subs[0]['@'].Id;
+ config.subscription = subs[0]['@'].Name;
account.writeConfig(config);
}
log.warn('The \'' + file + '\' file contains sensitive information.');
Oops, something went wrong.