Comparing version 0.0.3 to 0.0.4
@@ -7,8 +7,10 @@ var _ = require('lodash'); | ||
getFromOptions: (options) => { | ||
getFromOptions: function getFromOptions(options) { | ||
var asapConfigPath = options.configFile || './.asap-config'; | ||
return q() | ||
.then(() => fs.exists(asapConfigPath)) | ||
.then((exists) => { | ||
.then(function () { | ||
return fs.exists(asapConfigPath); | ||
}) | ||
.then(function (exists) { | ||
if (exists) { | ||
@@ -18,3 +20,3 @@ return fs.readFile(asapConfigPath); | ||
}) | ||
.then((fileContent) => { | ||
.then(function (fileContent) { | ||
if (fileContent) { | ||
@@ -27,9 +29,9 @@ return _.assign({}, JSON.parse(fileContent), options); | ||
validate: (config) => { | ||
validate: function validate(config) { | ||
var validateString = (value) => _.isString(value) && value; | ||
var validateArray = (value) => _.isArray(value) && value.length > 0; | ||
var validateString = function (value) { return _.isString(value) && value; }; | ||
var validateArray = function (value) { return _.isArray(value) && value.length > 0; }; | ||
var validators = [ | ||
_.partial((value) => validateArray(value) || validateString(value), config.audience), | ||
_.partial(function (value) { return validateArray(value) || validateString(value); }, config.audience), | ||
_.partial(validateString, config.issuer), | ||
@@ -40,3 +42,3 @@ _.partial(validateString, config.kid), | ||
var allRequiredConfigProvided = _.every(validators, (validator) => validator()); | ||
var allRequiredConfigProvided = _.every(validators, function (validator) { return validator(); }); | ||
if (!allRequiredConfigProvided) { | ||
@@ -50,6 +52,5 @@ return q.reject( | ||
save: (configFile, config) => { | ||
save: function save(configFile, config) { | ||
return fs.writeFile(configFile, JSON.stringify(config, null, 2)); | ||
} | ||
}; |
@@ -26,8 +26,4 @@ var jwtAuthentication = require('jwt-authentication'); | ||
return generateAuthorizationHeader(claims, authHeaderOpts) | ||
.catch((error) => { | ||
console.error('Generate JWT Auth Token failed.', error); | ||
return q.reject(error); | ||
}); | ||
return generateAuthorizationHeader(claims, authHeaderOpts); | ||
} | ||
}; |
{ | ||
"name": "asap-cli", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "A command line utility for generating ASAP (JWT tokens as per the Atlassian Service Authentication Protocol) token and making curl calls with the same.", | ||
"license": "MIT", | ||
"bin": { | ||
"asap": "./asap.js" | ||
"asap": "./bin/asap" | ||
}, | ||
@@ -39,3 +39,6 @@ "repository": { | ||
"proxyquire": "^1.7.4" | ||
}, | ||
"engines": { | ||
"node": ">=0.10" | ||
} | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
17007
13
202
2