Skip to content

Commit

Permalink
add token auth to node-smartdc
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnSonnenschein committed Feb 7, 2013
1 parent 2c93cb6 commit 7b08db8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/cloudapi.js
Expand Up @@ -18,8 +18,7 @@ var log = bunyan.createLogger({
stream: process.stderr,
serializers: {
err: bunyan.stdSerializers.err,
req: bunyan.stdSerializers.req,
res: restify.bunyan.serializers.response
req: bunyan.stdSerializers.req
}
});
var RestCodes = restify.RestCodes;
Expand Down Expand Up @@ -2101,7 +2100,7 @@ CloudAPI.prototype._request = function (path, body, callback) {
if (this.basicAuth) {
self.client.basicAuth(self.options.username, self.options.password);
} else {
if (this.token)
if (this.token != undefined)
obj.headers["X-Auth-Token"] = this.token;
if (!this.sshAgent) {
var alg = / DSA /.test(this.key) ? 'DSA-SHA1' : 'RSA-SHA256';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -22,7 +22,7 @@
"lru-cache": "1.1.0",
"nopt": "1.0.10",
"restify": "1.4.3",
"bunyan": "0.8.0",
"bunyan": ">0.8.0",
"ssh-agent": "0.1.0"
},
"devDependencies": {}
Expand Down

0 comments on commit 7b08db8

Please sign in to comment.