Skip to content

Commit

Permalink
Cleanup CI, fix JSCS
Browse files Browse the repository at this point in the history
  • Loading branch information
erikerikson committed Oct 20, 2017
1 parent 61b64b8 commit bdfbe53
Show file tree
Hide file tree
Showing 4 changed files with 1,248 additions and 21 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: node_js
node_js:
- "4"
- "6"
- "8"
14 changes: 7 additions & 7 deletions lib/aws-sigv4.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ var aws = require('aws-sdk'),
PARAM_REQUIRED: '" parameter is required',
PARAM_MUST_BE_STRING: '" param must have a string value',
HEADER_AUTHORIZATION: 'Authorization',
ERROR: ' ERROR (signature will not be added): ',
ERROR: ' ERROR (signature will not be added): '
},
messages = {
pluginConfigRequired: constants.THE + constants.PLUGIN_NAME + constants.CONFIG_REQUIRED + constants.PLUGIN_NAME,
pluginParamServiceNameRequired: constants.THE + constants.PLUGIN_PARAM_SERVICE_NAME + constants.PARAM_REQUIRED,
pluginParamServiceNameMustBeString: constants.THE + constants.PLUGIN_PARAM_SERVICE_NAME + constants.PARAM_MUST_BE_STRING,
sdkConfigInvalidError: constants.PLUGIN_PREFIX + constants.PLUGIN_NAME + constants.ERROR,
sdkConfigInvalidError: constants.PLUGIN_PREFIX + constants.PLUGIN_NAME + constants.ERROR
},
impl = {
validateScriptConfig: function(scriptConfig) {
Expand All @@ -35,11 +35,11 @@ var aws = require('aws-sdk'),
},
validateSdkConfig: function(credentials, region) {
var result = false;
if(!credentials) {
if (!credentials) {
console.log([
messages.sdkConfigInvalidError,
'credentials not obtained. ',
'Ensure the aws-sdk can obtain valid credentials.',
'Ensure the aws-sdk can obtain valid credentials.'
].join(''));
} else if (
!(
Expand All @@ -51,15 +51,15 @@ var aws = require('aws-sdk'),
messages.sdkConfigInvalidError,
'valid credentials not loaded. ',
'Ensure the aws-sdk can obtain credentials with either both accessKeyId and ',
'secretAccessKey attributes (optionally sessionToken) or a roleArn attribute.',
'secretAccessKey attributes (optionally sessionToken) or a roleArn attribute.'
].join(''));
} else if (!region) {
console.log([
messages.sdkConfigInvalidError,
'valid region not configured. ',
'Ensure the aws-sdk can obtain a valid region for use in signing your requests. ',
'Consider exporting or setting AWS_REGION. Alternatively specify a default ',
'region in your ~/.aws/config file.',
'region in your ~/.aws/config file.'
].join(''));
} else {
result = true;
Expand All @@ -75,7 +75,7 @@ var aws = require('aws-sdk'),
signer,
header;

if(impl.validateSdkConfig(credentials, region)) {
if (impl.validateSdkConfig(credentials, region)) {
req.method = requestParams.method;
req.path = targetUrl.path;
req.region = region;
Expand Down
Loading

0 comments on commit bdfbe53

Please sign in to comment.