ac-node-hipchat
Advanced tools
Comparing version 0.1.3 to 0.2.0
@@ -60,22 +60,2 @@ var _ = require('lodash'); | ||
if (scopes.length === 0) { | ||
throw new Error('At least one scope is required when genereating a token'); | ||
} | ||
self._ensureScopes(scopes); | ||
var cacheKey = (scopes || []).join('|'); | ||
return self._cache.get(cacheKey).then(function (tokenData) { | ||
if (tokenData) return tokenData; | ||
var tokenUrl = self._tenant.links.token; | ||
var username = self._tenant.id; | ||
var password = self._tenant.secret; | ||
return self._client.generateToken(tokenUrl, username, password, scopes); | ||
}).then(function (tokenData) { | ||
return self._cache.set(cacheKey, tokenData, tokenData.expires_in - 60).then(function () { | ||
return tokenData.access_token; | ||
}); | ||
}); | ||
}; | ||
TenantClient.prototype.getToken = function () { | ||
var self = this; | ||
var scopes = [].slice.call(arguments); | ||
if (scopes.length === 0) { | ||
throw new Error('At least one scope is required when generating a token'); | ||
@@ -82,0 +62,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"description": "A common module plugin for building Atlassian Connect add-ons for HipChat", | ||
"version": "0.1.3", | ||
"version": "0.2.0", | ||
"author": "Atlassian (http://atlassian.com)", | ||
@@ -17,3 +17,3 @@ "license": "Apache 2.0", | ||
"dependencies": { | ||
"ac-node": "^0.1.2", | ||
"ac-node": "^0.2.0", | ||
"check-types": "^1.3.1", | ||
@@ -20,0 +20,0 @@ "clone": "^0.1.17", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
77262
2217
+ Addedabort-controller@3.0.0(transitive)
+ Addedac-node@0.2.3(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedbson@0.2.22(transitive)
+ Addedbuffer@6.0.3(transitive)
+ Addedevent-target-shim@5.0.1(transitive)
+ Addedevents@3.3.0(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedkerberos@0.0.11(transitive)
+ Addedmongodb@1.4.40(transitive)
+ Addednan@1.8.4(transitive)
+ Addedprocess@0.11.10(transitive)
+ Addedreadable-stream@4.5.2(transitive)
+ Addedstring_decoder@1.3.0(transitive)
- Removedac-node@0.1.2(transitive)
Updatedac-node@^0.2.0