fsevents 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fsevents might be problematic. Click here for more details.
- package/node_modules/ansi/History.md +7 -0
- package/node_modules/ansi/LICENSE +24 -0
- package/node_modules/ansi/lib/ansi.js +2 -2
- package/node_modules/ansi/package.json +15 -10
- package/node_modules/ansi-regex/package.json +1 -0
- package/node_modules/ansi-styles/package.json +1 -0
- package/node_modules/are-we-there-yet/.npmignore +2 -0
- package/node_modules/are-we-there-yet/index.js +20 -18
- package/node_modules/are-we-there-yet/package.json +15 -13
- package/node_modules/asn1/package.json +3 -1
- package/node_modules/assert-plus/README.md +50 -21
- package/node_modules/assert-plus/assert.js +168 -207
- package/node_modules/assert-plus/package.json +55 -15
- package/node_modules/async/README.md +86 -4
- package/node_modules/async/dist/async.js +4 -3
- package/node_modules/async/dist/async.min.js +1 -1
- package/node_modules/async/lib/async.js +4 -3
- package/node_modules/async/package.json +10 -10
- package/node_modules/aws-sign2/package.json +1 -0
- package/node_modules/aws4/.npmignore +3 -0
- package/node_modules/aws4/.tern-port +1 -0
- package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match → aws4}/.travis.yml +2 -0
- package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md → aws4/LICENSE} +1 -3
- package/node_modules/aws4/README.md +510 -0
- package/node_modules/aws4/aws4.js +313 -0
- package/node_modules/aws4/example.js +372 -0
- package/node_modules/aws4/node_modules/lru-cache/.npmignore +1 -0
- package/node_modules/aws4/node_modules/lru-cache/.travis.yml +8 -0
- package/node_modules/aws4/node_modules/lru-cache/CONTRIBUTORS +14 -0
- package/node_modules/aws4/node_modules/lru-cache/README.md +137 -0
- package/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js +334 -0
- package/node_modules/aws4/node_modules/lru-cache/package.json +66 -0
- package/node_modules/aws4/node_modules/lru-cache/test/basic.js +396 -0
- package/node_modules/aws4/node_modules/lru-cache/test/foreach.js +120 -0
- package/node_modules/aws4/node_modules/lru-cache/test/memory-leak.js +51 -0
- package/node_modules/aws4/node_modules/lru-cache/test/serialize.js +216 -0
- package/node_modules/aws4/package.json +113 -0
- package/node_modules/bl/.travis.yml +5 -6
- package/node_modules/bl/bl.js +5 -0
- package/node_modules/bl/package.json +16 -13
- package/node_modules/bl/test/test.js +554 -6
- package/node_modules/block-stream/package.json +1 -0
- package/node_modules/boom/package.json +1 -0
- package/node_modules/caseless/package.json +1 -0
- package/node_modules/chalk/package.json +1 -0
- package/node_modules/combined-stream/package.json +1 -0
- package/node_modules/commander/package.json +1 -0
- package/node_modules/core-util-is/package.json +2 -2
- package/node_modules/cryptiles/package.json +1 -0
- package/node_modules/dashdash/README.md +70 -7
- package/node_modules/dashdash/etc/dashdash.bash_completion.in +388 -0
- package/node_modules/dashdash/lib/dashdash.js +202 -2
- package/node_modules/dashdash/package.json +12 -9
- package/node_modules/debug/.jshintrc +3 -0
- package/node_modules/debug/.npmignore +6 -0
- package/node_modules/debug/History.md +195 -0
- package/node_modules/debug/Makefile +36 -0
- package/node_modules/debug/Readme.md +86 -13
- package/node_modules/debug/bower.json +28 -0
- package/node_modules/debug/browser.js +168 -0
- package/node_modules/debug/component.json +19 -0
- package/node_modules/debug/debug.js +132 -72
- package/node_modules/debug/node.js +209 -0
- package/node_modules/debug/package.json +32 -22
- package/node_modules/deep-extend/README.md +51 -50
- package/node_modules/deep-extend/package.json +14 -16
- package/node_modules/delayed-stream/package.json +1 -0
- package/node_modules/delegates/History.md +6 -0
- package/node_modules/delegates/License +20 -0
- package/node_modules/delegates/package.json +17 -13
- package/node_modules/ecc-jsbn/package.json +3 -1
- package/node_modules/escape-string-regexp/package.json +2 -2
- package/node_modules/extend/package.json +1 -0
- package/node_modules/extsprintf/package.json +4 -2
- package/node_modules/forever-agent/package.json +1 -0
- package/node_modules/form-data/package.json +1 -0
- package/node_modules/fstream/package.json +1 -0
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +1 -0
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +1 -0
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json +1 -0
- package/node_modules/fstream-ignore/node_modules/minimatch/package.json +1 -0
- package/node_modules/fstream-ignore/package.json +3 -1
- package/node_modules/gauge/package.json +14 -12
- package/node_modules/gauge/progress-bar.js +4 -5
- package/node_modules/gauge/test/progress-bar.js +1 -1
- package/node_modules/generate-function/package.json +1 -0
- package/node_modules/generate-object-property/package.json +1 -0
- package/node_modules/graceful-fs/README.md +17 -0
- package/node_modules/graceful-fs/graceful-fs.js +2 -0
- package/node_modules/graceful-fs/package.json +16 -11
- package/node_modules/graceful-readlink/package.json +1 -0
- package/node_modules/har-validator/README.md +45 -122
- package/node_modules/har-validator/package.json +16 -16
- package/node_modules/has-ansi/package.json +1 -0
- package/node_modules/has-unicode/README.md +6 -3
- package/node_modules/has-unicode/index.js +7 -3
- package/node_modules/has-unicode/package.json +15 -13
- package/node_modules/has-unicode/test/index.js +1 -1
- package/node_modules/hawk/README.md +634 -634
- package/node_modules/hawk/bower.json +24 -24
- package/node_modules/hawk/component.json +18 -18
- package/node_modules/hawk/dist/client.js +343 -340
- package/node_modules/hawk/example/usage.js +78 -78
- package/node_modules/hawk/lib/browser.js +637 -637
- package/node_modules/hawk/lib/client.js +369 -369
- package/node_modules/hawk/lib/crypto.js +126 -126
- package/node_modules/hawk/lib/index.js +15 -15
- package/node_modules/hawk/lib/server.js +548 -540
- package/node_modules/hawk/lib/utils.js +184 -164
- package/node_modules/hawk/package.json +9 -8
- package/node_modules/hawk/test/browser.js +1492 -1492
- package/node_modules/hawk/test/client.js +440 -440
- package/node_modules/hawk/test/crypto.js +70 -70
- package/node_modules/hawk/test/index.js +378 -378
- package/node_modules/hawk/test/readme.js +95 -95
- package/node_modules/hawk/test/server.js +1329 -1302
- package/node_modules/hawk/test/uri.js +838 -838
- package/node_modules/hawk/test/utils.js +149 -121
- package/node_modules/hoek/package.json +1 -0
- package/node_modules/http-signature/CHANGES.md +7 -0
- package/node_modules/http-signature/http_signing.md +71 -3
- package/node_modules/http-signature/lib/signer.js +5 -0
- package/node_modules/http-signature/package.json +13 -11
- package/node_modules/ini/package.json +3 -1
- package/node_modules/is-my-json-valid/formats.js +1 -1
- package/node_modules/is-my-json-valid/package.json +11 -10
- package/node_modules/is-property/package.json +1 -0
- package/node_modules/is-typedarray/package.json +3 -1
- package/node_modules/isarray/package.json +2 -2
- package/node_modules/isstream/package.json +1 -0
- package/node_modules/jodid25519/package.json +3 -1
- package/node_modules/jsbn/package.json +3 -1
- package/node_modules/json-schema/package.json +2 -1
- package/node_modules/json-stringify-safe/package.json +1 -0
- package/node_modules/jsonpointer/package.json +1 -0
- package/node_modules/jsprim/package.json +3 -1
- package/node_modules/lodash._basetostring/package.json +4 -4
- package/node_modules/lodash._createpadding/package.json +3 -2
- package/node_modules/lodash._root/LICENSE +22 -0
- package/node_modules/lodash._root/README.md +18 -0
- package/node_modules/lodash._root/index.js +53 -0
- package/node_modules/lodash._root/package.json +77 -0
- package/node_modules/lodash.pad/LICENSE +2 -2
- package/node_modules/lodash.pad/README.md +4 -6
- package/node_modules/lodash.pad/index.js +347 -15
- package/node_modules/lodash.pad/package.json +20 -34
- package/node_modules/lodash.padleft/package.json +3 -1
- package/node_modules/lodash.padright/package.json +3 -1
- package/node_modules/lodash.repeat/LICENSE +2 -2
- package/node_modules/lodash.repeat/README.md +4 -6
- package/node_modules/lodash.repeat/index.js +262 -11
- package/node_modules/lodash.repeat/package.json +21 -34
- package/node_modules/mime-db/package.json +2 -2
- package/node_modules/mime-types/package.json +2 -2
- package/node_modules/ms/.npmignore +5 -0
- package/node_modules/{deep-extend → ms}/LICENSE +2 -2
- package/node_modules/ms/README.md +35 -0
- package/node_modules/ms/index.js +125 -0
- package/node_modules/ms/package.json +56 -0
- package/node_modules/node-pre-gyp/CHANGELOG.md +8 -0
- package/node_modules/node-pre-gyp/LICENSE +27 -0
- package/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json +36 -0
- package/node_modules/node-pre-gyp/package.json +23 -22
- package/node_modules/node-uuid/package.json +1 -0
- package/node_modules/npmlog/package.json +18 -16
- package/node_modules/oauth-sign/index.js +2 -0
- package/node_modules/oauth-sign/package.json +10 -9
- package/node_modules/once/README.md +18 -0
- package/node_modules/once/once.js +8 -6
- package/node_modules/once/package.json +20 -12
- package/node_modules/pinkie/index.js +3 -3
- package/node_modules/pinkie/package.json +10 -9
- package/node_modules/pinkie/readme.md +1 -1
- package/node_modules/pinkie-promise/package.json +1 -0
- package/node_modules/process-nextick-args/package.json +2 -2
- package/node_modules/qs/.eslintrc +17 -0
- package/node_modules/qs/.travis.yml +66 -5
- package/node_modules/qs/CHANGELOG.md +86 -75
- package/node_modules/qs/README.md +85 -81
- package/node_modules/qs/bower.json +1 -1
- package/node_modules/qs/component.json +1 -1
- package/node_modules/qs/dist/qs.js +108 -177
- package/node_modules/qs/lib/index.js +1 -7
- package/node_modules/qs/lib/parse.js +26 -49
- package/node_modules/qs/lib/stringify.js +22 -46
- package/node_modules/qs/lib/utils.js +45 -73
- package/node_modules/qs/package.json +51 -28
- package/node_modules/qs/test/index.js +5 -0
- package/node_modules/qs/test/parse.js +236 -321
- package/node_modules/qs/test/stringify.js +139 -197
- package/node_modules/qs/test/utils.js +6 -25
- package/node_modules/rc/node_modules/minimist/package.json +1 -0
- package/node_modules/rc/package.json +1 -0
- package/node_modules/readable-stream/package.json +1 -0
- package/node_modules/request/CHANGELOG.md +16 -1
- package/node_modules/request/README.md +1 -1
- package/node_modules/request/lib/har.js +3 -2
- package/node_modules/request/lib/multipart.js +3 -0
- package/node_modules/request/lib/tunnel.js +0 -2
- package/node_modules/request/package.json +20 -17
- package/node_modules/request/request.js +50 -26
- package/node_modules/rimraf/README.md +1 -1
- package/node_modules/rimraf/node_modules/glob/README.md +2 -2
- package/node_modules/rimraf/node_modules/glob/glob.js +14 -1
- package/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/inflight/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/inherits/package.json +2 -1
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/once/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/package.json +11 -11
- package/node_modules/rimraf/package.json +13 -12
- package/node_modules/semver/package.json +3 -1
- package/node_modules/sntp/package.json +1 -0
- package/node_modules/sshpk/.npmignore +1 -0
- package/node_modules/sshpk/bin/sshpk-sign +176 -0
- package/node_modules/sshpk/bin/sshpk-verify +166 -0
- package/node_modules/sshpk/lib/ed-compat.js +2 -0
- package/node_modules/sshpk/lib/key.js +6 -0
- package/node_modules/sshpk/man/man1/sshpk-conv.1 +135 -0
- package/node_modules/sshpk/man/man1/sshpk-sign.1 +81 -0
- package/node_modules/sshpk/man/man1/sshpk-verify.1 +68 -0
- package/node_modules/sshpk/package.json +18 -9
- package/node_modules/string_decoder/package.json +2 -2
- package/node_modules/stringstream/package.json +1 -0
- package/node_modules/strip-ansi/package.json +1 -0
- package/node_modules/strip-json-comments/package.json +1 -0
- package/node_modules/supports-color/package.json +1 -0
- package/node_modules/tar/package.json +1 -0
- package/node_modules/tar-pack/README.md +2 -2
- package/node_modules/tar-pack/package.json +25 -26
- package/node_modules/tough-cookie/package.json +1 -0
- package/node_modules/tunnel-agent/package.json +1 -0
- package/node_modules/tweetnacl/README.md +1 -1
- package/node_modules/tweetnacl/package.json +13 -11
- package/node_modules/uid-number/package.json +14 -13
- package/node_modules/uid-number/uid-number.js +9 -4
- package/node_modules/util-deprecate/package.json +2 -2
- package/node_modules/verror/package.json +1 -0
- package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy → wrappy}/package.json +3 -2
- package/node_modules/xtend/package.json +1 -0
- package/package.json +2 -2
- package/node_modules/are-we-there-yet/README.md~ +0 -183
- package/node_modules/bl/test/basic-test.js +0 -541
- package/node_modules/bl/test/sauce.js +0 -38
- package/node_modules/debug/index.js +0 -5
- package/node_modules/debug/lib/debug.js +0 -147
- package/node_modules/deep-extend/test/index.spec.js +0 -220
- package/node_modules/deep-extend/test/mocha.opts +0 -1
- package/node_modules/gauge/README.md~ +0 -161
- package/node_modules/has-unicode/README.md~ +0 -4
- package/node_modules/once/LICENSE +0 -27
- package/node_modules/once/test/once.js +0 -18
- package/node_modules/sshpk/node_modules/assert-plus/README.md +0 -155
- package/node_modules/sshpk/node_modules/assert-plus/assert.js +0 -206
- package/node_modules/sshpk/node_modules/assert-plus/package.json +0 -88
- package/node_modules/tar-pack/node_modules/rimraf/README.md +0 -43
- package/node_modules/tar-pack/node_modules/rimraf/bin.js +0 -40
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/README.md +0 -359
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/common.js +0 -226
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/glob.js +0 -752
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/.eslintrc +0 -17
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/README.md +0 -37
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/inflight.js +0 -44
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy/package.json +0 -58
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/package.json +0 -67
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/test.js +0 -97
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inherits/LICENSE +0 -16
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inherits/README.md +0 -42
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inherits/inherits.js +0 -1
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inherits/inherits_browser.js +0 -23
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inherits/package.json +0 -58
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inherits/test.js +0 -25
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/README.md +0 -216
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/minimatch.js +0 -912
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore +0 -3
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +0 -122
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js +0 -8
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +0 -191
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore +0 -2
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile +0 -6
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +0 -89
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js +0 -5
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +0 -50
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +0 -79
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +0 -84
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml +0 -4
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE +0 -18
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown +0 -62
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js +0 -6
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js +0 -13
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +0 -90
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js +0 -39
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +0 -81
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/package.json +0 -66
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/README.md +0 -51
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/LICENSE +0 -15
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/README.md +0 -36
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/test/basic.js +0 -51
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/wrappy.js +0 -33
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/once.js +0 -21
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/package.json +0 -70
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/index.js +0 -20
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/package.json +0 -78
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/readme.md +0 -51
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/package.json +0 -79
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/sync.js +0 -460
- package/node_modules/tar-pack/node_modules/rimraf/package.json +0 -69
- package/node_modules/tar-pack/node_modules/rimraf/rimraf.js +0 -333
- package/node_modules/uid-number/LICENCE +0 -25
- /package/node_modules/{sshpk/node_modules/assert-plus → assert-plus}/AUTHORS +0 -0
- /package/node_modules/{sshpk/node_modules/assert-plus → assert-plus}/CHANGES.md +0 -0
- /package/node_modules/{tar-pack/node_modules/rimraf → aws4/node_modules/lru-cache}/LICENSE +0 -0
- /package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight → uid-number}/LICENSE +0 -0
- /package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy → wrappy}/LICENSE +0 -0
- /package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy → wrappy}/README.md +0 -0
- /package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy → wrappy}/test/basic.js +0 -0
- /package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy → wrappy}/wrappy.js +0 -0
@@ -0,0 +1,510 @@
|
|
1
|
+
aws4
|
2
|
+
----
|
3
|
+
|
4
|
+
[![Build Status](https://secure.travis-ci.org/mhart/aws4.png?branch=master)](http://travis-ci.org/mhart/aws4)
|
5
|
+
|
6
|
+
A small utility to sign vanilla node.js http(s) request options using Amazon's
|
7
|
+
[AWS Signature Version 4](http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html).
|
8
|
+
|
9
|
+
This signature is supported by nearly all Amazon services, including
|
10
|
+
[S3](http://docs.aws.amazon.com/AmazonS3/latest/API/),
|
11
|
+
[EC2](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/),
|
12
|
+
[DynamoDB](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/API.html),
|
13
|
+
[Kinesis](http://docs.aws.amazon.com/kinesis/latest/APIReference/),
|
14
|
+
[Lambda](http://docs.aws.amazon.com/lambda/latest/dg/API_Reference.html),
|
15
|
+
[SQS](http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/),
|
16
|
+
[SNS](http://docs.aws.amazon.com/sns/latest/api/),
|
17
|
+
[IAM](http://docs.aws.amazon.com/IAM/latest/APIReference/),
|
18
|
+
[STS](http://docs.aws.amazon.com/STS/latest/APIReference/),
|
19
|
+
[RDS](http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/),
|
20
|
+
[CloudWatch](http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/),
|
21
|
+
[CloudWatch Logs](http://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/),
|
22
|
+
[CodeDeploy](http://docs.aws.amazon.com/codedeploy/latest/APIReference/),
|
23
|
+
[CloudFront](http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/),
|
24
|
+
[CloudTrail](http://docs.aws.amazon.com/awscloudtrail/latest/APIReference/),
|
25
|
+
[ElastiCache](http://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/),
|
26
|
+
[EMR](http://docs.aws.amazon.com/ElasticMapReduce/latest/API/),
|
27
|
+
[Glacier](http://docs.aws.amazon.com/amazonglacier/latest/dev/amazon-glacier-api.html),
|
28
|
+
[CloudSearch](http://docs.aws.amazon.com/cloudsearch/latest/developerguide/APIReq.html),
|
29
|
+
[Elastic Load Balancing](http://docs.aws.amazon.com/ElasticLoadBalancing/latest/APIReference/),
|
30
|
+
[Elastic Transcoder](http://docs.aws.amazon.com/elastictranscoder/latest/developerguide/api-reference.html),
|
31
|
+
[CloudFormation](http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/),
|
32
|
+
[Elastic Beanstalk](http://docs.aws.amazon.com/elasticbeanstalk/latest/api/),
|
33
|
+
[Storage Gateway](http://docs.aws.amazon.com/storagegateway/latest/userguide/AWSStorageGatewayAPI.html),
|
34
|
+
[Data Pipeline](http://docs.aws.amazon.com/datapipeline/latest/APIReference/),
|
35
|
+
[Direct Connect](http://docs.aws.amazon.com/directconnect/latest/APIReference/),
|
36
|
+
[Redshift](http://docs.aws.amazon.com/redshift/latest/APIReference/),
|
37
|
+
[OpsWorks](http://docs.aws.amazon.com/opsworks/latest/APIReference/),
|
38
|
+
[SES](http://docs.aws.amazon.com/ses/latest/APIReference/),
|
39
|
+
[SWF](http://docs.aws.amazon.com/amazonswf/latest/apireference/),
|
40
|
+
[AutoScaling](http://docs.aws.amazon.com/AutoScaling/latest/APIReference/),
|
41
|
+
[Mobile Analytics](http://docs.aws.amazon.com/mobileanalytics/latest/ug/server-reference.html),
|
42
|
+
[Cognito Identity](http://docs.aws.amazon.com/cognitoidentity/latest/APIReference/),
|
43
|
+
[Cognito Sync](http://docs.aws.amazon.com/cognitosync/latest/APIReference/),
|
44
|
+
[Container Service](http://docs.aws.amazon.com/AmazonECS/latest/APIReference/),
|
45
|
+
[AppStream](http://docs.aws.amazon.com/appstream/latest/developerguide/appstream-api-rest.html),
|
46
|
+
[Key Management Service](http://docs.aws.amazon.com/kms/latest/APIReference/),
|
47
|
+
[Config](http://docs.aws.amazon.com/config/latest/APIReference/),
|
48
|
+
[CloudHSM](http://docs.aws.amazon.com/cloudhsm/latest/dg/api-ref.html),
|
49
|
+
[Route53](http://docs.aws.amazon.com/Route53/latest/APIReference/requests-rest.html) and
|
50
|
+
[Route53 Domains](http://docs.aws.amazon.com/Route53/latest/APIReference/requests-rpc.html).
|
51
|
+
|
52
|
+
Indeed, the only AWS services that *don't* support v4 as of 2014-12-30 are
|
53
|
+
[Import/Export](http://docs.aws.amazon.com/AWSImportExport/latest/DG/api-reference.html) and
|
54
|
+
[SimpleDB](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/SDB_API.html)
|
55
|
+
(they only support [AWS Signature Version 2](https://github.com/mhart/aws2)).
|
56
|
+
|
57
|
+
It also provides defaults for a number of core AWS headers and
|
58
|
+
request parameters, making it very easy to query AWS services, or
|
59
|
+
build out a fully-featured AWS library.
|
60
|
+
|
61
|
+
Example
|
62
|
+
-------
|
63
|
+
|
64
|
+
```javascript
|
65
|
+
var http = require('http'),
|
66
|
+
https = require('https'),
|
67
|
+
aws4 = require('aws4')
|
68
|
+
|
69
|
+
// given an options object you could pass to http.request
|
70
|
+
var opts = {host: 'sqs.us-east-1.amazonaws.com', path: '/?Action=ListQueues'}
|
71
|
+
|
72
|
+
// alternatively (as aws4 can infer the host):
|
73
|
+
opts = {service: 'sqs', region: 'us-east-1', path: '/?Action=ListQueues'}
|
74
|
+
|
75
|
+
// alternatively (as us-east-1 is default):
|
76
|
+
opts = {service: 'sqs', path: '/?Action=ListQueues'}
|
77
|
+
|
78
|
+
aws4.sign(opts) // assumes AWS credentials are available in process.env
|
79
|
+
|
80
|
+
console.log(opts)
|
81
|
+
/*
|
82
|
+
{
|
83
|
+
host: 'sqs.us-east-1.amazonaws.com',
|
84
|
+
path: '/?Action=ListQueues',
|
85
|
+
headers: {
|
86
|
+
Host: 'sqs.us-east-1.amazonaws.com',
|
87
|
+
'X-Amz-Date': '20121226T061030Z',
|
88
|
+
Authorization: 'AWS4-HMAC-SHA256 Credential=ABCDEF/20121226/us-east-1/sqs/aws4_request, ...'
|
89
|
+
}
|
90
|
+
}
|
91
|
+
*/
|
92
|
+
|
93
|
+
// we can now use this to query AWS using the standard node.js http API
|
94
|
+
http.request(opts, function(res) { res.pipe(process.stdout) }).end()
|
95
|
+
/*
|
96
|
+
<?xml version="1.0"?>
|
97
|
+
<ListQueuesResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/">
|
98
|
+
...
|
99
|
+
*/
|
100
|
+
```
|
101
|
+
|
102
|
+
More options
|
103
|
+
------------
|
104
|
+
|
105
|
+
```javascript
|
106
|
+
// you can also pass AWS credentials in explicitly (otherwise taken from process.env)
|
107
|
+
aws4.sign(opts, {accessKeyId: '', secretAccessKey: ''})
|
108
|
+
|
109
|
+
// can also add the signature to query strings
|
110
|
+
aws4.sign({service: 's3', path: '/my-bucket?X-Amz-Expires=12345', signQuery: true})
|
111
|
+
|
112
|
+
// create a utility function to pipe to stdout (with https this time)
|
113
|
+
function request(o) { https.request(o, function(res) { res.pipe(process.stdout) }).end(o.body || '') }
|
114
|
+
|
115
|
+
// aws4 can infer the HTTP method if a body is passed in
|
116
|
+
// method will be POST and Content-Type: 'application/x-www-form-urlencoded; charset=utf-8'
|
117
|
+
request(aws4.sign({service: 'iam', body: 'Action=ListGroups&Version=2010-05-08'}))
|
118
|
+
/*
|
119
|
+
<ListGroupsResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
|
120
|
+
...
|
121
|
+
*/
|
122
|
+
|
123
|
+
// can specify any custom option or header as per usual
|
124
|
+
request(aws4.sign({
|
125
|
+
service: 'dynamodb',
|
126
|
+
region: 'ap-southeast-2',
|
127
|
+
method: 'POST',
|
128
|
+
path: '/',
|
129
|
+
headers: {
|
130
|
+
'Content-Type': 'application/x-amz-json-1.0',
|
131
|
+
'X-Amz-Target': 'DynamoDB_20120810.ListTables'
|
132
|
+
},
|
133
|
+
body: '{}'
|
134
|
+
}))
|
135
|
+
/*
|
136
|
+
{"TableNames":[]}
|
137
|
+
...
|
138
|
+
*/
|
139
|
+
|
140
|
+
// works with all other services that support Signature Version 4
|
141
|
+
|
142
|
+
request(aws4.sign({service: 's3', path: '/', signQuery: true}))
|
143
|
+
/*
|
144
|
+
<ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
145
|
+
...
|
146
|
+
*/
|
147
|
+
|
148
|
+
request(aws4.sign({service: 'ec2', path: '/?Action=DescribeRegions&Version=2014-06-15'}))
|
149
|
+
/*
|
150
|
+
<DescribeRegionsResponse xmlns="http://ec2.amazonaws.com/doc/2014-06-15/">
|
151
|
+
...
|
152
|
+
*/
|
153
|
+
|
154
|
+
request(aws4.sign({service: 'sns', path: '/?Action=ListTopics&Version=2010-03-31'}))
|
155
|
+
/*
|
156
|
+
<ListTopicsResponse xmlns="http://sns.amazonaws.com/doc/2010-03-31/">
|
157
|
+
...
|
158
|
+
*/
|
159
|
+
|
160
|
+
request(aws4.sign({service: 'sts', path: '/?Action=GetSessionToken&Version=2011-06-15'}))
|
161
|
+
/*
|
162
|
+
<GetSessionTokenResponse xmlns="https://sts.amazonaws.com/doc/2011-06-15/">
|
163
|
+
...
|
164
|
+
*/
|
165
|
+
|
166
|
+
request(aws4.sign({service: 'cloudsearch', path: '/?Action=ListDomainNames&Version=2013-01-01'}))
|
167
|
+
/*
|
168
|
+
<ListDomainNamesResponse xmlns="http://cloudsearch.amazonaws.com/doc/2013-01-01/">
|
169
|
+
...
|
170
|
+
*/
|
171
|
+
|
172
|
+
request(aws4.sign({service: 'ses', path: '/?Action=ListIdentities&Version=2010-12-01'}))
|
173
|
+
/*
|
174
|
+
<ListIdentitiesResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
|
175
|
+
...
|
176
|
+
*/
|
177
|
+
|
178
|
+
request(aws4.sign({service: 'autoscaling', path: '/?Action=DescribeAutoScalingInstances&Version=2011-01-01'}))
|
179
|
+
/*
|
180
|
+
<DescribeAutoScalingInstancesResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/">
|
181
|
+
...
|
182
|
+
*/
|
183
|
+
|
184
|
+
request(aws4.sign({service: 'elasticloadbalancing', path: '/?Action=DescribeLoadBalancers&Version=2012-06-01'}))
|
185
|
+
/*
|
186
|
+
<DescribeLoadBalancersResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2012-06-01/">
|
187
|
+
...
|
188
|
+
*/
|
189
|
+
|
190
|
+
request(aws4.sign({service: 'cloudformation', path: '/?Action=ListStacks&Version=2010-05-15'}))
|
191
|
+
/*
|
192
|
+
<ListStacksResponse xmlns="http://cloudformation.amazonaws.com/doc/2010-05-15/">
|
193
|
+
...
|
194
|
+
*/
|
195
|
+
|
196
|
+
request(aws4.sign({service: 'elasticbeanstalk', path: '/?Action=ListAvailableSolutionStacks&Version=2010-12-01'}))
|
197
|
+
/*
|
198
|
+
<ListAvailableSolutionStacksResponse xmlns="http://elasticbeanstalk.amazonaws.com/docs/2010-12-01/">
|
199
|
+
...
|
200
|
+
*/
|
201
|
+
|
202
|
+
request(aws4.sign({service: 'rds', path: '/?Action=DescribeDBInstances&Version=2012-09-17'}))
|
203
|
+
/*
|
204
|
+
<DescribeDBInstancesResponse xmlns="http://rds.amazonaws.com/doc/2012-09-17/">
|
205
|
+
...
|
206
|
+
*/
|
207
|
+
|
208
|
+
request(aws4.sign({service: 'monitoring', path: '/?Action=ListMetrics&Version=2010-08-01'}))
|
209
|
+
/*
|
210
|
+
<ListMetricsResponse xmlns="http://monitoring.amazonaws.com/doc/2010-08-01/">
|
211
|
+
...
|
212
|
+
*/
|
213
|
+
|
214
|
+
request(aws4.sign({service: 'redshift', path: '/?Action=DescribeClusters&Version=2012-12-01'}))
|
215
|
+
/*
|
216
|
+
<DescribeClustersResponse xmlns="http://redshift.amazonaws.com/doc/2012-12-01/">
|
217
|
+
...
|
218
|
+
*/
|
219
|
+
|
220
|
+
request(aws4.sign({service: 'cloudfront', path: '/2014-05-31/distribution'}))
|
221
|
+
/*
|
222
|
+
<DistributionList xmlns="http://cloudfront.amazonaws.com/doc/2014-05-31/">
|
223
|
+
...
|
224
|
+
*/
|
225
|
+
|
226
|
+
request(aws4.sign({service: 'elasticache', path: '/?Action=DescribeCacheClusters&Version=2014-07-15'}))
|
227
|
+
/*
|
228
|
+
<DescribeCacheClustersResponse xmlns="http://elasticache.amazonaws.com/doc/2014-07-15/">
|
229
|
+
...
|
230
|
+
*/
|
231
|
+
|
232
|
+
request(aws4.sign({service: 'elasticmapreduce', path: '/?Action=DescribeJobFlows&Version=2009-03-31'}))
|
233
|
+
/*
|
234
|
+
<DescribeJobFlowsResponse xmlns="http://elasticmapreduce.amazonaws.com/doc/2009-03-31">
|
235
|
+
...
|
236
|
+
*/
|
237
|
+
|
238
|
+
request(aws4.sign({service: 'route53', path: '/2013-04-01/hostedzone'}))
|
239
|
+
/*
|
240
|
+
<ListHostedZonesResponse xmlns="https://route53.amazonaws.com/doc/2013-04-01/">
|
241
|
+
...
|
242
|
+
*/
|
243
|
+
|
244
|
+
request(aws4.sign({service: 'appstream', path: '/applications'}))
|
245
|
+
/*
|
246
|
+
{"_links":{"curie":[{"href":"http://docs.aws.amazon.com/appstream/latest/...
|
247
|
+
...
|
248
|
+
*/
|
249
|
+
|
250
|
+
request(aws4.sign({service: 'cognito-sync', path: '/identitypools'}))
|
251
|
+
/*
|
252
|
+
{"Count":0,"IdentityPoolUsages":[],"MaxResults":16,"NextToken":null}
|
253
|
+
...
|
254
|
+
*/
|
255
|
+
|
256
|
+
request(aws4.sign({service: 'elastictranscoder', path: '/2012-09-25/pipelines'}))
|
257
|
+
/*
|
258
|
+
{"NextPageToken":null,"Pipelines":[]}
|
259
|
+
...
|
260
|
+
*/
|
261
|
+
|
262
|
+
request(aws4.sign({service: 'lambda', path: '/2014-11-13/functions/'}))
|
263
|
+
/*
|
264
|
+
{"Functions":[],"NextMarker":null}
|
265
|
+
...
|
266
|
+
*/
|
267
|
+
|
268
|
+
request(aws4.sign({service: 'ecs', path: '/?Action=ListClusters&Version=2014-11-13'}))
|
269
|
+
/*
|
270
|
+
<ListClustersResponse xmlns="http://ecs.amazonaws.com/doc/2014-11-13/">
|
271
|
+
...
|
272
|
+
*/
|
273
|
+
|
274
|
+
request(aws4.sign({service: 'glacier', path: '/-/vaults', headers: {'X-Amz-Glacier-Version': '2012-06-01'}}))
|
275
|
+
/*
|
276
|
+
{"Marker":null,"VaultList":[]}
|
277
|
+
...
|
278
|
+
*/
|
279
|
+
|
280
|
+
request(aws4.sign({service: 'storagegateway', body: '{}', headers: {
|
281
|
+
'Content-Type': 'application/x-amz-json-1.1',
|
282
|
+
'X-Amz-Target': 'StorageGateway_20120630.ListGateways'
|
283
|
+
}}))
|
284
|
+
/*
|
285
|
+
{"Gateways":[]}
|
286
|
+
...
|
287
|
+
*/
|
288
|
+
|
289
|
+
request(aws4.sign({service: 'datapipeline', body: '{}', headers: {
|
290
|
+
'Content-Type': 'application/x-amz-json-1.1',
|
291
|
+
'X-Amz-Target': 'DataPipeline.ListPipelines'
|
292
|
+
}}))
|
293
|
+
/*
|
294
|
+
{"hasMoreResults":false,"pipelineIdList":[]}
|
295
|
+
...
|
296
|
+
*/
|
297
|
+
|
298
|
+
request(aws4.sign({service: 'opsworks', body: '{}', headers: {
|
299
|
+
'Content-Type': 'application/x-amz-json-1.1',
|
300
|
+
'X-Amz-Target': 'OpsWorks_20130218.DescribeStacks'
|
301
|
+
}}))
|
302
|
+
/*
|
303
|
+
{"Stacks":[]}
|
304
|
+
...
|
305
|
+
*/
|
306
|
+
|
307
|
+
request(aws4.sign({service: 'route53domains', body: '{}', headers: {
|
308
|
+
'Content-Type': 'application/x-amz-json-1.1',
|
309
|
+
'X-Amz-Target': 'Route53Domains_v20140515.ListDomains'
|
310
|
+
}}))
|
311
|
+
/*
|
312
|
+
{"Domains":[]}
|
313
|
+
...
|
314
|
+
*/
|
315
|
+
|
316
|
+
request(aws4.sign({service: 'kinesis', body: '{}', headers: {
|
317
|
+
'Content-Type': 'application/x-amz-json-1.1',
|
318
|
+
'X-Amz-Target': 'Kinesis_20131202.ListStreams'
|
319
|
+
}}))
|
320
|
+
/*
|
321
|
+
{"HasMoreStreams":false,"StreamNames":[]}
|
322
|
+
...
|
323
|
+
*/
|
324
|
+
|
325
|
+
request(aws4.sign({service: 'cloudtrail', body: '{}', headers: {
|
326
|
+
'Content-Type': 'application/x-amz-json-1.1',
|
327
|
+
'X-Amz-Target': 'CloudTrail_20131101.DescribeTrails'
|
328
|
+
}}))
|
329
|
+
/*
|
330
|
+
{"trailList":[]}
|
331
|
+
...
|
332
|
+
*/
|
333
|
+
|
334
|
+
request(aws4.sign({service: 'logs', body: '{}', headers: {
|
335
|
+
'Content-Type': 'application/x-amz-json-1.1',
|
336
|
+
'X-Amz-Target': 'Logs_20140328.DescribeLogGroups'
|
337
|
+
}}))
|
338
|
+
/*
|
339
|
+
{"logGroups":[]}
|
340
|
+
...
|
341
|
+
*/
|
342
|
+
|
343
|
+
request(aws4.sign({service: 'codedeploy', body: '{}', headers: {
|
344
|
+
'Content-Type': 'application/x-amz-json-1.1',
|
345
|
+
'X-Amz-Target': 'CodeDeploy_20141006.ListApplications'
|
346
|
+
}}))
|
347
|
+
/*
|
348
|
+
{"applications":[]}
|
349
|
+
...
|
350
|
+
*/
|
351
|
+
|
352
|
+
request(aws4.sign({service: 'directconnect', body: '{}', headers: {
|
353
|
+
'Content-Type': 'application/x-amz-json-1.1',
|
354
|
+
'X-Amz-Target': 'OvertureService.DescribeConnections'
|
355
|
+
}}))
|
356
|
+
/*
|
357
|
+
{"connections":[]}
|
358
|
+
...
|
359
|
+
*/
|
360
|
+
|
361
|
+
request(aws4.sign({service: 'kms', body: '{}', headers: {
|
362
|
+
'Content-Type': 'application/x-amz-json-1.1',
|
363
|
+
'X-Amz-Target': 'TrentService.ListKeys'
|
364
|
+
}}))
|
365
|
+
/*
|
366
|
+
{"Keys":[],"Truncated":false}
|
367
|
+
...
|
368
|
+
*/
|
369
|
+
|
370
|
+
request(aws4.sign({service: 'config', body: '{}', headers: {
|
371
|
+
'Content-Type': 'application/x-amz-json-1.1',
|
372
|
+
'X-Amz-Target': 'StarlingDoveService.DescribeDeliveryChannels'
|
373
|
+
}}))
|
374
|
+
/*
|
375
|
+
{"DeliveryChannels":[]}
|
376
|
+
...
|
377
|
+
*/
|
378
|
+
|
379
|
+
request(aws4.sign({service: 'cloudhsm', body: '{}', headers: {
|
380
|
+
'Content-Type': 'application/x-amz-json-1.1',
|
381
|
+
'X-Amz-Target': 'CloudHsmFrontendService.ListAvailableZones'
|
382
|
+
}}))
|
383
|
+
/*
|
384
|
+
{"AZList":["us-east-1a","us-east-1b","us-east-1c"]}
|
385
|
+
...
|
386
|
+
*/
|
387
|
+
|
388
|
+
request(aws4.sign({
|
389
|
+
service: 'swf',
|
390
|
+
body: '{"registrationStatus":"REGISTERED"}',
|
391
|
+
headers: {
|
392
|
+
'Content-Type': 'application/x-amz-json-1.0',
|
393
|
+
'X-Amz-Target': 'SimpleWorkflowService.ListDomains'
|
394
|
+
}
|
395
|
+
}))
|
396
|
+
/*
|
397
|
+
{"domainInfos":[]}
|
398
|
+
...
|
399
|
+
*/
|
400
|
+
|
401
|
+
request(aws4.sign({
|
402
|
+
service: 'cognito-identity',
|
403
|
+
body: '{"MaxResults": 1}',
|
404
|
+
headers: {
|
405
|
+
'Content-Type': 'application/x-amz-json-1.1',
|
406
|
+
'X-Amz-Target': 'AWSCognitoIdentityService.ListIdentityPools'
|
407
|
+
}
|
408
|
+
}))
|
409
|
+
/*
|
410
|
+
{"IdentityPools":[]}
|
411
|
+
...
|
412
|
+
*/
|
413
|
+
|
414
|
+
request(aws4.sign({
|
415
|
+
service: 'mobileanalytics',
|
416
|
+
path: '/2014-06-05/events',
|
417
|
+
body: JSON.stringify({events:[{
|
418
|
+
eventType: 'a',
|
419
|
+
timestamp: new Date().toISOString(),
|
420
|
+
session: {},
|
421
|
+
}]}),
|
422
|
+
headers: {
|
423
|
+
'Content-Type': 'application/json',
|
424
|
+
'X-Amz-Client-Context': JSON.stringify({
|
425
|
+
client: {client_id: 'a', app_title: 'a'},
|
426
|
+
custom: {},
|
427
|
+
env: {platform: 'a'},
|
428
|
+
services: {},
|
429
|
+
}),
|
430
|
+
}
|
431
|
+
}))
|
432
|
+
/*
|
433
|
+
(HTTP 202, empty response)
|
434
|
+
*/
|
435
|
+
```
|
436
|
+
|
437
|
+
API
|
438
|
+
---
|
439
|
+
|
440
|
+
### aws4.sign(requestOptions, [credentials])
|
441
|
+
|
442
|
+
This calculates and populates the `Authorization` header of
|
443
|
+
`requestOptions`, and any other necessary AWS headers and/or request
|
444
|
+
options. Returns `requestOptions` as a convenience for chaining.
|
445
|
+
|
446
|
+
`requestOptions` is an object holding the same options that the node.js
|
447
|
+
[http.request](http://nodejs.org/docs/latest/api/http.html#http_http_request_options_callback)
|
448
|
+
function takes.
|
449
|
+
|
450
|
+
The following properties of `requestOptions` are used in the signing or
|
451
|
+
populated if they don't already exist:
|
452
|
+
|
453
|
+
- `hostname` or `host` (will be determined from `service` and `region` if not given)
|
454
|
+
- `method` (will use `'GET'` if not given or `'POST'` if there is a `body`)
|
455
|
+
- `path` (will use `'/'` if not given)
|
456
|
+
- `body` (will use `''` if not given)
|
457
|
+
- `service` (will be calculated from `hostname` or `host` if not given)
|
458
|
+
- `region` (will be calculated from `hostname` or `host` or use `'us-east-1'` if not given)
|
459
|
+
- `headers['Host']` (will use `hostname` or `host` or be calculated if not given)
|
460
|
+
- `headers['Content-Type']` (will use `'application/x-www-form-urlencoded; charset=utf-8'`
|
461
|
+
if not given and there is a `body`)
|
462
|
+
- `headers['Date']` (used to calculate the signature date if given, otherwise `new Date` is used)
|
463
|
+
|
464
|
+
Your AWS credentials (which can be found in your
|
465
|
+
[AWS console](https://portal.aws.amazon.com/gp/aws/securityCredentials))
|
466
|
+
can be specified in one of two ways:
|
467
|
+
|
468
|
+
- As the second argument, like this:
|
469
|
+
|
470
|
+
```javascript
|
471
|
+
aws4.sign(requestOptions, {
|
472
|
+
secretAccessKey: "<your-secret-access-key>",
|
473
|
+
accessKeyId: "<your-access-key-id>",
|
474
|
+
sessionToken: "<your-session-token>"
|
475
|
+
})
|
476
|
+
```
|
477
|
+
|
478
|
+
- From `process.env`, such as this:
|
479
|
+
|
480
|
+
```
|
481
|
+
export AWS_SECRET_ACCESS_KEY="<your-secret-access-key>"
|
482
|
+
export AWS_ACCESS_KEY_ID="<your-access-key-id>"
|
483
|
+
export AWS_SESSION_TOKEN="<your-session-token>"
|
484
|
+
```
|
485
|
+
|
486
|
+
(will also use `AWS_ACCESS_KEY` and `AWS_SECRET_KEY` if available)
|
487
|
+
|
488
|
+
The `sessionToken` property and `AWS_SESSION_TOKEN` environment variable are optional for signing
|
489
|
+
with [IAM STS temporary credentials](http://docs.aws.amazon.com/STS/latest/UsingSTS/using-temp-creds.html).
|
490
|
+
|
491
|
+
Installation
|
492
|
+
------------
|
493
|
+
|
494
|
+
With [npm](http://npmjs.org/) do:
|
495
|
+
|
496
|
+
```
|
497
|
+
npm install aws4
|
498
|
+
```
|
499
|
+
|
500
|
+
Thanks
|
501
|
+
------
|
502
|
+
|
503
|
+
Thanks to [@jed](https://github.com/jed) for his
|
504
|
+
[dynamo-client](https://github.com/jed/dynamo-client) lib where I first
|
505
|
+
committed and subsequently extracted this code.
|
506
|
+
|
507
|
+
Also thanks to the
|
508
|
+
[official node.js AWS SDK](https://github.com/aws/aws-sdk-js) for giving
|
509
|
+
me a start on implementing the v4 signature.
|
510
|
+
|