Skip to content

Commit

Permalink
dependencies: Set aws-sign as optional dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbo87 committed Oct 15, 2013
1 parent 1cd81ba commit e87d45f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@
"tunnel-agent": "~0.3.0",
"http-signature": "~0.10.0",
"hawk": "~1.0.0",
"aws-sign": "~0.3.0",
"oauth-sign": "~0.3.0",
"tough-cookie": "~0.9.15",
"node-uuid": "~1.4.0",
"mime": "~1.2.9",
"form-data": "~0.1.0"
},
"optionalDependencies": {
"aws-sign": "~0.3.0"
},
"scripts": {
"test": "node tests/run.js"
}
Expand Down
2 changes: 1 addition & 1 deletion request.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var optional = require('./lib/optional')

, oauth = require('oauth-sign')
, hawk = require('hawk')
, aws = require('aws-sign')
, aws = optional('aws-sign')
, httpSignature = require('http-signature')
, uuid = require('node-uuid')
, mime = require('mime')
Expand Down
14 changes: 11 additions & 3 deletions tests/test-s3.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
try {
require('aws-sign')
} catch (e) {
console.error('aws-sign must be installed to run this test.')
console.error('skipping this test. please install aws-sign and run again if you need to test this feature.')
process.exit(0)
}

var request = require('../index')

var r = request.get('https://log.curlybracecast.com.s3.amazonaws.com/',
{ aws:
var r = request.get('https://log.curlybracecast.com.s3.amazonaws.com/',
{ aws:
{ key: 'AKIAI6KIQRRVMGK3WK5Q'
, secret: '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'
, bucket: 'log.curlybracecast.com'
Expand All @@ -10,4 +18,4 @@ var r = request.get('https://log.curlybracecast.com.s3.amazonaws.com/',
console.log(r.headers)
console.log(body)
}
)
)

0 comments on commit e87d45f

Please sign in to comment.