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
@@ -1,440 +1,440 @@
|
|
1
|
-
// Load modules
|
2
|
-
|
3
|
-
var Url = require('url');
|
4
|
-
var Code = require('code');
|
5
|
-
var Hawk = require('../lib');
|
6
|
-
var Lab = require('lab');
|
7
|
-
|
8
|
-
|
9
|
-
// Declare internals
|
10
|
-
|
11
|
-
var internals = {};
|
12
|
-
|
13
|
-
|
14
|
-
// Test shortcuts
|
15
|
-
|
16
|
-
var lab = exports.lab = Lab.script();
|
17
|
-
var describe = lab.experiment;
|
18
|
-
var it = lab.test;
|
19
|
-
var expect = Code.expect;
|
20
|
-
|
21
|
-
|
22
|
-
describe('Client', function () {
|
23
|
-
|
24
|
-
describe('header()', function () {
|
25
|
-
|
26
|
-
it('returns a valid authorization header (sha1)', function (done) {
|
27
|
-
|
28
|
-
var credentials = {
|
29
|
-
id: '123456',
|
30
|
-
key: '2983d45yun89q',
|
31
|
-
algorithm: 'sha1'
|
32
|
-
};
|
33
|
-
|
34
|
-
var header = Hawk.client.header('http://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about' }).field;
|
35
|
-
expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="bsvY3IfUllw6V5rvk4tStEvpBhE=", ext="Bazinga!", mac="qbf1ZPG/r/e06F4ht+T77LXi5vw="');
|
36
|
-
done();
|
37
|
-
});
|
38
|
-
|
39
|
-
it('returns a valid authorization header (sha256)', function (done) {
|
40
|
-
|
41
|
-
var credentials = {
|
42
|
-
id: '123456',
|
43
|
-
key: '2983d45yun89q',
|
44
|
-
algorithm: 'sha256'
|
45
|
-
};
|
46
|
-
|
47
|
-
var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' }).field;
|
48
|
-
expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", ext="Bazinga!", mac="q1CwFoSHzPZSkbIvl0oYlD+91rBUEvFk763nMjMndj8="');
|
49
|
-
done();
|
50
|
-
});
|
51
|
-
|
52
|
-
it('returns a valid authorization header (no ext)', function (done) {
|
53
|
-
|
54
|
-
var credentials = {
|
55
|
-
id: '123456',
|
56
|
-
key: '2983d45yun89q',
|
57
|
-
algorithm: 'sha256'
|
58
|
-
};
|
59
|
-
|
60
|
-
var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' }).field;
|
61
|
-
expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", mac="HTgtd0jPI6E4izx8e4OHdO36q00xFCU0FolNq3RiCYs="');
|
62
|
-
done();
|
63
|
-
});
|
64
|
-
|
65
|
-
it('returns a valid authorization header (null ext)', function (done) {
|
66
|
-
|
67
|
-
var credentials = {
|
68
|
-
id: '123456',
|
69
|
-
key: '2983d45yun89q',
|
70
|
-
algorithm: 'sha256'
|
71
|
-
};
|
72
|
-
|
73
|
-
var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain', ext: null }).field;
|
74
|
-
expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", mac="HTgtd0jPI6E4izx8e4OHdO36q00xFCU0FolNq3RiCYs="');
|
75
|
-
done();
|
76
|
-
});
|
77
|
-
|
78
|
-
it('returns a valid authorization header (empty payload)', function (done) {
|
79
|
-
|
80
|
-
var credentials = {
|
81
|
-
id: '123456',
|
82
|
-
key: '2983d45yun89q',
|
83
|
-
algorithm: 'sha256'
|
84
|
-
};
|
85
|
-
|
86
|
-
var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: '', contentType: 'text/plain' }).field;
|
87
|
-
expect(header).to.equal('Hawk id=\"123456\", ts=\"1353809207\", nonce=\"Ygvqdz\", hash=\"q/t+NNAkQZNlq/aAD6PlexImwQTxwgT2MahfTa9XRLA=\", mac=\"U5k16YEzn3UnBHKeBzsDXn067Gu3R4YaY6xOt9PYRZM=\"');
|
88
|
-
done();
|
89
|
-
});
|
90
|
-
|
91
|
-
it('returns a valid authorization header (pre hashed payload)', function (done) {
|
92
|
-
|
93
|
-
var credentials = {
|
94
|
-
id: '123456',
|
95
|
-
key: '2983d45yun89q',
|
96
|
-
algorithm: 'sha256'
|
97
|
-
};
|
98
|
-
|
99
|
-
var options = { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' };
|
100
|
-
options.hash = Hawk.crypto.calculatePayloadHash(options.payload, credentials.algorithm, options.contentType);
|
101
|
-
var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', options).field;
|
102
|
-
expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", mac="HTgtd0jPI6E4izx8e4OHdO36q00xFCU0FolNq3RiCYs="');
|
103
|
-
done();
|
104
|
-
});
|
105
|
-
|
106
|
-
it('errors on missing uri', function (done) {
|
107
|
-
|
108
|
-
var header = Hawk.client.header('', 'POST');
|
109
|
-
expect(header.field).to.equal('');
|
110
|
-
expect(header.err).to.equal('Invalid argument type');
|
111
|
-
done();
|
112
|
-
});
|
113
|
-
|
114
|
-
it('errors on invalid uri', function (done) {
|
115
|
-
|
116
|
-
var header = Hawk.client.header(4, 'POST');
|
117
|
-
expect(header.field).to.equal('');
|
118
|
-
expect(header.err).to.equal('Invalid argument type');
|
119
|
-
done();
|
120
|
-
});
|
121
|
-
|
122
|
-
it('errors on missing method', function (done) {
|
123
|
-
|
124
|
-
var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', '');
|
125
|
-
expect(header.field).to.equal('');
|
126
|
-
expect(header.err).to.equal('Invalid argument type');
|
127
|
-
done();
|
128
|
-
});
|
129
|
-
|
130
|
-
it('errors on invalid method', function (done) {
|
131
|
-
|
132
|
-
var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 5);
|
133
|
-
expect(header.field).to.equal('');
|
134
|
-
expect(header.err).to.equal('Invalid argument type');
|
135
|
-
done();
|
136
|
-
});
|
137
|
-
|
138
|
-
it('errors on missing options', function (done) {
|
139
|
-
|
140
|
-
var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST');
|
141
|
-
expect(header.field).to.equal('');
|
142
|
-
expect(header.err).to.equal('Invalid argument type');
|
143
|
-
done();
|
144
|
-
});
|
145
|
-
|
146
|
-
it('errors on invalid credentials (id)', function (done) {
|
147
|
-
|
148
|
-
var credentials = {
|
149
|
-
key: '2983d45yun89q',
|
150
|
-
algorithm: 'sha256'
|
151
|
-
};
|
152
|
-
|
153
|
-
var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207 });
|
154
|
-
expect(header.field).to.equal('');
|
155
|
-
expect(header.err).to.equal('Invalid credential object');
|
156
|
-
done();
|
157
|
-
});
|
158
|
-
|
159
|
-
it('errors on missing credentials', function (done) {
|
160
|
-
|
161
|
-
var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { ext: 'Bazinga!', timestamp: 1353809207 });
|
162
|
-
expect(header.field).to.equal('');
|
163
|
-
expect(header.err).to.equal('Invalid credential object');
|
164
|
-
done();
|
165
|
-
});
|
166
|
-
|
167
|
-
it('errors on invalid credentials', function (done) {
|
168
|
-
|
169
|
-
var credentials = {
|
170
|
-
id: '123456',
|
171
|
-
algorithm: 'sha256'
|
172
|
-
};
|
173
|
-
|
174
|
-
var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207 });
|
175
|
-
expect(header.field).to.equal('');
|
176
|
-
expect(header.err).to.equal('Invalid credential object');
|
177
|
-
done();
|
178
|
-
});
|
179
|
-
|
180
|
-
it('errors on invalid algorithm', function (done) {
|
181
|
-
|
182
|
-
var credentials = {
|
183
|
-
id: '123456',
|
184
|
-
key: '2983d45yun89q',
|
185
|
-
algorithm: 'hmac-sha-0'
|
186
|
-
};
|
187
|
-
|
188
|
-
var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, payload: 'something, anything!', ext: 'Bazinga!', timestamp: 1353809207 });
|
189
|
-
expect(header.field).to.equal('');
|
190
|
-
expect(header.err).to.equal('Unknown algorithm');
|
191
|
-
done();
|
192
|
-
});
|
193
|
-
});
|
194
|
-
|
195
|
-
describe('authenticate()', function () {
|
196
|
-
|
197
|
-
it('returns false on invalid header', function (done) {
|
198
|
-
|
199
|
-
var res = {
|
200
|
-
headers: {
|
201
|
-
'server-authorization': 'Hawk mac="abc", bad="xyz"'
|
202
|
-
}
|
203
|
-
};
|
204
|
-
|
205
|
-
expect(Hawk.client.authenticate(res, {})).to.equal(false);
|
206
|
-
done();
|
207
|
-
});
|
208
|
-
|
209
|
-
it('returns false on invalid mac', function (done) {
|
210
|
-
|
211
|
-
var res = {
|
212
|
-
headers: {
|
213
|
-
'content-type': 'text/plain',
|
214
|
-
'server-authorization': 'Hawk mac="_IJRsMl/4oL+nn+vKoeVZPdCHXB4yJkNnBbTbHFZUYE=", hash="f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=", ext="response-specific"'
|
215
|
-
}
|
216
|
-
};
|
217
|
-
|
218
|
-
var artifacts = {
|
219
|
-
method: 'POST',
|
220
|
-
host: 'example.com',
|
221
|
-
port: '8080',
|
222
|
-
resource: '/resource/4?filter=a',
|
223
|
-
ts: '1362336900',
|
224
|
-
nonce: 'eb5S_L',
|
225
|
-
hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
|
226
|
-
ext: 'some-app-data',
|
227
|
-
app: undefined,
|
228
|
-
dlg: undefined,
|
229
|
-
mac: 'BlmSe8K+pbKIb6YsZCnt4E1GrYvY1AaYayNR82dGpIk=',
|
230
|
-
id: '123456'
|
231
|
-
};
|
232
|
-
|
233
|
-
var credentials = {
|
234
|
-
id: '123456',
|
235
|
-
key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
|
236
|
-
algorithm: 'sha256',
|
237
|
-
user: 'steve'
|
238
|
-
};
|
239
|
-
|
240
|
-
expect(Hawk.client.authenticate(res, credentials, artifacts)).to.equal(false);
|
241
|
-
done();
|
242
|
-
});
|
243
|
-
|
244
|
-
it('returns true on ignoring hash', function (done) {
|
245
|
-
|
246
|
-
var res = {
|
247
|
-
headers: {
|
248
|
-
'content-type': 'text/plain',
|
249
|
-
'server-authorization': 'Hawk mac="XIJRsMl/4oL+nn+vKoeVZPdCHXB4yJkNnBbTbHFZUYE=", hash="f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=", ext="response-specific"'
|
250
|
-
}
|
251
|
-
};
|
252
|
-
|
253
|
-
var artifacts = {
|
254
|
-
method: 'POST',
|
255
|
-
host: 'example.com',
|
256
|
-
port: '8080',
|
257
|
-
resource: '/resource/4?filter=a',
|
258
|
-
ts: '1362336900',
|
259
|
-
nonce: 'eb5S_L',
|
260
|
-
hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
|
261
|
-
ext: 'some-app-data',
|
262
|
-
app: undefined,
|
263
|
-
dlg: undefined,
|
264
|
-
mac: 'BlmSe8K+pbKIb6YsZCnt4E1GrYvY1AaYayNR82dGpIk=',
|
265
|
-
id: '123456'
|
266
|
-
};
|
267
|
-
|
268
|
-
var credentials = {
|
269
|
-
id: '123456',
|
270
|
-
key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
|
271
|
-
algorithm: 'sha256',
|
272
|
-
user: 'steve'
|
273
|
-
};
|
274
|
-
|
275
|
-
expect(Hawk.client.authenticate(res, credentials, artifacts)).to.equal(true);
|
276
|
-
done();
|
277
|
-
});
|
278
|
-
|
279
|
-
it('fails on invalid WWW-Authenticate header format', function (done) {
|
280
|
-
|
281
|
-
var header = 'Hawk ts="1362346425875", tsm="PhwayS28vtnn3qbv0mqRBYSXebN/zggEtucfeZ620Zo=", x="Stale timestamp"';
|
282
|
-
expect(Hawk.client.authenticate({ headers: { 'www-authenticate': header } }, {})).to.equal(false);
|
283
|
-
done();
|
284
|
-
});
|
285
|
-
|
286
|
-
it('fails on invalid WWW-Authenticate header format', function (done) {
|
287
|
-
|
288
|
-
var credentials = {
|
289
|
-
id: '123456',
|
290
|
-
key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
|
291
|
-
algorithm: 'sha256',
|
292
|
-
user: 'steve'
|
293
|
-
};
|
294
|
-
|
295
|
-
var header = 'Hawk ts="1362346425875", tsm="hwayS28vtnn3qbv0mqRBYSXebN/zggEtucfeZ620Zo=", error="Stale timestamp"';
|
296
|
-
expect(Hawk.client.authenticate({ headers: { 'www-authenticate': header } }, credentials)).to.equal(false);
|
297
|
-
done();
|
298
|
-
});
|
299
|
-
|
300
|
-
it('skips tsm validation when missing ts', function (done) {
|
301
|
-
|
302
|
-
var header = 'Hawk error="Stale timestamp"';
|
303
|
-
expect(Hawk.client.authenticate({ headers: { 'www-authenticate': header } }, {})).to.equal(true);
|
304
|
-
done();
|
305
|
-
});
|
306
|
-
});
|
307
|
-
|
308
|
-
describe('message()', function () {
|
309
|
-
|
310
|
-
it('generates authorization', function (done) {
|
311
|
-
|
312
|
-
var credentials = {
|
313
|
-
id: '123456',
|
314
|
-
key: '2983d45yun89q',
|
315
|
-
algorithm: 'sha1'
|
316
|
-
};
|
317
|
-
|
318
|
-
var auth = Hawk.client.message('example.com', 80, 'I am the boodyman', { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
|
319
|
-
expect(auth).to.exist();
|
320
|
-
expect(auth.ts).to.equal(1353809207);
|
321
|
-
expect(auth.nonce).to.equal('abc123');
|
322
|
-
done();
|
323
|
-
});
|
324
|
-
|
325
|
-
it('errors on invalid host', function (done) {
|
326
|
-
|
327
|
-
var credentials = {
|
328
|
-
id: '123456',
|
329
|
-
key: '2983d45yun89q',
|
330
|
-
algorithm: 'sha1'
|
331
|
-
};
|
332
|
-
|
333
|
-
var auth = Hawk.client.message(5, 80, 'I am the boodyman', { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
|
334
|
-
expect(auth).to.not.exist();
|
335
|
-
done();
|
336
|
-
});
|
337
|
-
|
338
|
-
it('errors on invalid port', function (done) {
|
339
|
-
|
340
|
-
var credentials = {
|
341
|
-
id: '123456',
|
342
|
-
key: '2983d45yun89q',
|
343
|
-
algorithm: 'sha1'
|
344
|
-
};
|
345
|
-
|
346
|
-
var auth = Hawk.client.message('example.com', '80', 'I am the boodyman', { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
|
347
|
-
expect(auth).to.not.exist();
|
348
|
-
done();
|
349
|
-
});
|
350
|
-
|
351
|
-
it('errors on missing host', function (done) {
|
352
|
-
|
353
|
-
var credentials = {
|
354
|
-
id: '123456',
|
355
|
-
key: '2983d45yun89q',
|
356
|
-
algorithm: 'sha1'
|
357
|
-
};
|
358
|
-
|
359
|
-
var auth = Hawk.client.message('example.com', 0, 'I am the boodyman', { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
|
360
|
-
expect(auth).to.not.exist();
|
361
|
-
done();
|
362
|
-
});
|
363
|
-
|
364
|
-
it('errors on null message', function (done) {
|
365
|
-
|
366
|
-
var credentials = {
|
367
|
-
id: '123456',
|
368
|
-
key: '2983d45yun89q',
|
369
|
-
algorithm: 'sha1'
|
370
|
-
};
|
371
|
-
|
372
|
-
var auth = Hawk.client.message('example.com', 80, null, { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
|
373
|
-
expect(auth).to.not.exist();
|
374
|
-
done();
|
375
|
-
});
|
376
|
-
|
377
|
-
it('errors on missing message', function (done) {
|
378
|
-
|
379
|
-
var credentials = {
|
380
|
-
id: '123456',
|
381
|
-
key: '2983d45yun89q',
|
382
|
-
algorithm: 'sha1'
|
383
|
-
};
|
384
|
-
|
385
|
-
var auth = Hawk.client.message('example.com', 80, undefined, { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
|
386
|
-
expect(auth).to.not.exist();
|
387
|
-
done();
|
388
|
-
});
|
389
|
-
|
390
|
-
it('errors on invalid message', function (done) {
|
391
|
-
|
392
|
-
var credentials = {
|
393
|
-
id: '123456',
|
394
|
-
key: '2983d45yun89q',
|
395
|
-
algorithm: 'sha1'
|
396
|
-
};
|
397
|
-
|
398
|
-
var auth = Hawk.client.message('example.com', 80, 5, { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
|
399
|
-
expect(auth).to.not.exist();
|
400
|
-
done();
|
401
|
-
});
|
402
|
-
|
403
|
-
it('errors on missing options', function (done) {
|
404
|
-
|
405
|
-
var credentials = {
|
406
|
-
id: '123456',
|
407
|
-
key: '2983d45yun89q',
|
408
|
-
algorithm: 'sha1'
|
409
|
-
};
|
410
|
-
|
411
|
-
var auth = Hawk.client.message('example.com', 80, 'I am the boodyman');
|
412
|
-
expect(auth).to.not.exist();
|
413
|
-
done();
|
414
|
-
});
|
415
|
-
|
416
|
-
it('errors on invalid credentials (id)', function (done) {
|
417
|
-
|
418
|
-
var credentials = {
|
419
|
-
key: '2983d45yun89q',
|
420
|
-
algorithm: 'sha1'
|
421
|
-
};
|
422
|
-
|
423
|
-
var auth = Hawk.client.message('example.com', 80, 'I am the boodyman', { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
|
424
|
-
expect(auth).to.not.exist();
|
425
|
-
done();
|
426
|
-
});
|
427
|
-
|
428
|
-
it('errors on invalid credentials (key)', function (done) {
|
429
|
-
|
430
|
-
var credentials = {
|
431
|
-
id: '123456',
|
432
|
-
algorithm: 'sha1'
|
433
|
-
};
|
434
|
-
|
435
|
-
var auth = Hawk.client.message('example.com', 80, 'I am the boodyman', { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
|
436
|
-
expect(auth).to.not.exist();
|
437
|
-
done();
|
438
|
-
});
|
439
|
-
});
|
440
|
-
});
|
1
|
+
// Load modules
|
2
|
+
|
3
|
+
var Url = require('url');
|
4
|
+
var Code = require('code');
|
5
|
+
var Hawk = require('../lib');
|
6
|
+
var Lab = require('lab');
|
7
|
+
|
8
|
+
|
9
|
+
// Declare internals
|
10
|
+
|
11
|
+
var internals = {};
|
12
|
+
|
13
|
+
|
14
|
+
// Test shortcuts
|
15
|
+
|
16
|
+
var lab = exports.lab = Lab.script();
|
17
|
+
var describe = lab.experiment;
|
18
|
+
var it = lab.test;
|
19
|
+
var expect = Code.expect;
|
20
|
+
|
21
|
+
|
22
|
+
describe('Client', function () {
|
23
|
+
|
24
|
+
describe('header()', function () {
|
25
|
+
|
26
|
+
it('returns a valid authorization header (sha1)', function (done) {
|
27
|
+
|
28
|
+
var credentials = {
|
29
|
+
id: '123456',
|
30
|
+
key: '2983d45yun89q',
|
31
|
+
algorithm: 'sha1'
|
32
|
+
};
|
33
|
+
|
34
|
+
var header = Hawk.client.header('http://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about' }).field;
|
35
|
+
expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="bsvY3IfUllw6V5rvk4tStEvpBhE=", ext="Bazinga!", mac="qbf1ZPG/r/e06F4ht+T77LXi5vw="');
|
36
|
+
done();
|
37
|
+
});
|
38
|
+
|
39
|
+
it('returns a valid authorization header (sha256)', function (done) {
|
40
|
+
|
41
|
+
var credentials = {
|
42
|
+
id: '123456',
|
43
|
+
key: '2983d45yun89q',
|
44
|
+
algorithm: 'sha256'
|
45
|
+
};
|
46
|
+
|
47
|
+
var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' }).field;
|
48
|
+
expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", ext="Bazinga!", mac="q1CwFoSHzPZSkbIvl0oYlD+91rBUEvFk763nMjMndj8="');
|
49
|
+
done();
|
50
|
+
});
|
51
|
+
|
52
|
+
it('returns a valid authorization header (no ext)', function (done) {
|
53
|
+
|
54
|
+
var credentials = {
|
55
|
+
id: '123456',
|
56
|
+
key: '2983d45yun89q',
|
57
|
+
algorithm: 'sha256'
|
58
|
+
};
|
59
|
+
|
60
|
+
var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' }).field;
|
61
|
+
expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", mac="HTgtd0jPI6E4izx8e4OHdO36q00xFCU0FolNq3RiCYs="');
|
62
|
+
done();
|
63
|
+
});
|
64
|
+
|
65
|
+
it('returns a valid authorization header (null ext)', function (done) {
|
66
|
+
|
67
|
+
var credentials = {
|
68
|
+
id: '123456',
|
69
|
+
key: '2983d45yun89q',
|
70
|
+
algorithm: 'sha256'
|
71
|
+
};
|
72
|
+
|
73
|
+
var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain', ext: null }).field;
|
74
|
+
expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", mac="HTgtd0jPI6E4izx8e4OHdO36q00xFCU0FolNq3RiCYs="');
|
75
|
+
done();
|
76
|
+
});
|
77
|
+
|
78
|
+
it('returns a valid authorization header (empty payload)', function (done) {
|
79
|
+
|
80
|
+
var credentials = {
|
81
|
+
id: '123456',
|
82
|
+
key: '2983d45yun89q',
|
83
|
+
algorithm: 'sha256'
|
84
|
+
};
|
85
|
+
|
86
|
+
var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: '', contentType: 'text/plain' }).field;
|
87
|
+
expect(header).to.equal('Hawk id=\"123456\", ts=\"1353809207\", nonce=\"Ygvqdz\", hash=\"q/t+NNAkQZNlq/aAD6PlexImwQTxwgT2MahfTa9XRLA=\", mac=\"U5k16YEzn3UnBHKeBzsDXn067Gu3R4YaY6xOt9PYRZM=\"');
|
88
|
+
done();
|
89
|
+
});
|
90
|
+
|
91
|
+
it('returns a valid authorization header (pre hashed payload)', function (done) {
|
92
|
+
|
93
|
+
var credentials = {
|
94
|
+
id: '123456',
|
95
|
+
key: '2983d45yun89q',
|
96
|
+
algorithm: 'sha256'
|
97
|
+
};
|
98
|
+
|
99
|
+
var options = { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' };
|
100
|
+
options.hash = Hawk.crypto.calculatePayloadHash(options.payload, credentials.algorithm, options.contentType);
|
101
|
+
var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', options).field;
|
102
|
+
expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", mac="HTgtd0jPI6E4izx8e4OHdO36q00xFCU0FolNq3RiCYs="');
|
103
|
+
done();
|
104
|
+
});
|
105
|
+
|
106
|
+
it('errors on missing uri', function (done) {
|
107
|
+
|
108
|
+
var header = Hawk.client.header('', 'POST');
|
109
|
+
expect(header.field).to.equal('');
|
110
|
+
expect(header.err).to.equal('Invalid argument type');
|
111
|
+
done();
|
112
|
+
});
|
113
|
+
|
114
|
+
it('errors on invalid uri', function (done) {
|
115
|
+
|
116
|
+
var header = Hawk.client.header(4, 'POST');
|
117
|
+
expect(header.field).to.equal('');
|
118
|
+
expect(header.err).to.equal('Invalid argument type');
|
119
|
+
done();
|
120
|
+
});
|
121
|
+
|
122
|
+
it('errors on missing method', function (done) {
|
123
|
+
|
124
|
+
var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', '');
|
125
|
+
expect(header.field).to.equal('');
|
126
|
+
expect(header.err).to.equal('Invalid argument type');
|
127
|
+
done();
|
128
|
+
});
|
129
|
+
|
130
|
+
it('errors on invalid method', function (done) {
|
131
|
+
|
132
|
+
var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 5);
|
133
|
+
expect(header.field).to.equal('');
|
134
|
+
expect(header.err).to.equal('Invalid argument type');
|
135
|
+
done();
|
136
|
+
});
|
137
|
+
|
138
|
+
it('errors on missing options', function (done) {
|
139
|
+
|
140
|
+
var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST');
|
141
|
+
expect(header.field).to.equal('');
|
142
|
+
expect(header.err).to.equal('Invalid argument type');
|
143
|
+
done();
|
144
|
+
});
|
145
|
+
|
146
|
+
it('errors on invalid credentials (id)', function (done) {
|
147
|
+
|
148
|
+
var credentials = {
|
149
|
+
key: '2983d45yun89q',
|
150
|
+
algorithm: 'sha256'
|
151
|
+
};
|
152
|
+
|
153
|
+
var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207 });
|
154
|
+
expect(header.field).to.equal('');
|
155
|
+
expect(header.err).to.equal('Invalid credential object');
|
156
|
+
done();
|
157
|
+
});
|
158
|
+
|
159
|
+
it('errors on missing credentials', function (done) {
|
160
|
+
|
161
|
+
var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { ext: 'Bazinga!', timestamp: 1353809207 });
|
162
|
+
expect(header.field).to.equal('');
|
163
|
+
expect(header.err).to.equal('Invalid credential object');
|
164
|
+
done();
|
165
|
+
});
|
166
|
+
|
167
|
+
it('errors on invalid credentials', function (done) {
|
168
|
+
|
169
|
+
var credentials = {
|
170
|
+
id: '123456',
|
171
|
+
algorithm: 'sha256'
|
172
|
+
};
|
173
|
+
|
174
|
+
var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207 });
|
175
|
+
expect(header.field).to.equal('');
|
176
|
+
expect(header.err).to.equal('Invalid credential object');
|
177
|
+
done();
|
178
|
+
});
|
179
|
+
|
180
|
+
it('errors on invalid algorithm', function (done) {
|
181
|
+
|
182
|
+
var credentials = {
|
183
|
+
id: '123456',
|
184
|
+
key: '2983d45yun89q',
|
185
|
+
algorithm: 'hmac-sha-0'
|
186
|
+
};
|
187
|
+
|
188
|
+
var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, payload: 'something, anything!', ext: 'Bazinga!', timestamp: 1353809207 });
|
189
|
+
expect(header.field).to.equal('');
|
190
|
+
expect(header.err).to.equal('Unknown algorithm');
|
191
|
+
done();
|
192
|
+
});
|
193
|
+
});
|
194
|
+
|
195
|
+
describe('authenticate()', function () {
|
196
|
+
|
197
|
+
it('returns false on invalid header', function (done) {
|
198
|
+
|
199
|
+
var res = {
|
200
|
+
headers: {
|
201
|
+
'server-authorization': 'Hawk mac="abc", bad="xyz"'
|
202
|
+
}
|
203
|
+
};
|
204
|
+
|
205
|
+
expect(Hawk.client.authenticate(res, {})).to.equal(false);
|
206
|
+
done();
|
207
|
+
});
|
208
|
+
|
209
|
+
it('returns false on invalid mac', function (done) {
|
210
|
+
|
211
|
+
var res = {
|
212
|
+
headers: {
|
213
|
+
'content-type': 'text/plain',
|
214
|
+
'server-authorization': 'Hawk mac="_IJRsMl/4oL+nn+vKoeVZPdCHXB4yJkNnBbTbHFZUYE=", hash="f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=", ext="response-specific"'
|
215
|
+
}
|
216
|
+
};
|
217
|
+
|
218
|
+
var artifacts = {
|
219
|
+
method: 'POST',
|
220
|
+
host: 'example.com',
|
221
|
+
port: '8080',
|
222
|
+
resource: '/resource/4?filter=a',
|
223
|
+
ts: '1362336900',
|
224
|
+
nonce: 'eb5S_L',
|
225
|
+
hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
|
226
|
+
ext: 'some-app-data',
|
227
|
+
app: undefined,
|
228
|
+
dlg: undefined,
|
229
|
+
mac: 'BlmSe8K+pbKIb6YsZCnt4E1GrYvY1AaYayNR82dGpIk=',
|
230
|
+
id: '123456'
|
231
|
+
};
|
232
|
+
|
233
|
+
var credentials = {
|
234
|
+
id: '123456',
|
235
|
+
key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
|
236
|
+
algorithm: 'sha256',
|
237
|
+
user: 'steve'
|
238
|
+
};
|
239
|
+
|
240
|
+
expect(Hawk.client.authenticate(res, credentials, artifacts)).to.equal(false);
|
241
|
+
done();
|
242
|
+
});
|
243
|
+
|
244
|
+
it('returns true on ignoring hash', function (done) {
|
245
|
+
|
246
|
+
var res = {
|
247
|
+
headers: {
|
248
|
+
'content-type': 'text/plain',
|
249
|
+
'server-authorization': 'Hawk mac="XIJRsMl/4oL+nn+vKoeVZPdCHXB4yJkNnBbTbHFZUYE=", hash="f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=", ext="response-specific"'
|
250
|
+
}
|
251
|
+
};
|
252
|
+
|
253
|
+
var artifacts = {
|
254
|
+
method: 'POST',
|
255
|
+
host: 'example.com',
|
256
|
+
port: '8080',
|
257
|
+
resource: '/resource/4?filter=a',
|
258
|
+
ts: '1362336900',
|
259
|
+
nonce: 'eb5S_L',
|
260
|
+
hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
|
261
|
+
ext: 'some-app-data',
|
262
|
+
app: undefined,
|
263
|
+
dlg: undefined,
|
264
|
+
mac: 'BlmSe8K+pbKIb6YsZCnt4E1GrYvY1AaYayNR82dGpIk=',
|
265
|
+
id: '123456'
|
266
|
+
};
|
267
|
+
|
268
|
+
var credentials = {
|
269
|
+
id: '123456',
|
270
|
+
key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
|
271
|
+
algorithm: 'sha256',
|
272
|
+
user: 'steve'
|
273
|
+
};
|
274
|
+
|
275
|
+
expect(Hawk.client.authenticate(res, credentials, artifacts)).to.equal(true);
|
276
|
+
done();
|
277
|
+
});
|
278
|
+
|
279
|
+
it('fails on invalid WWW-Authenticate header format', function (done) {
|
280
|
+
|
281
|
+
var header = 'Hawk ts="1362346425875", tsm="PhwayS28vtnn3qbv0mqRBYSXebN/zggEtucfeZ620Zo=", x="Stale timestamp"';
|
282
|
+
expect(Hawk.client.authenticate({ headers: { 'www-authenticate': header } }, {})).to.equal(false);
|
283
|
+
done();
|
284
|
+
});
|
285
|
+
|
286
|
+
it('fails on invalid WWW-Authenticate header format', function (done) {
|
287
|
+
|
288
|
+
var credentials = {
|
289
|
+
id: '123456',
|
290
|
+
key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
|
291
|
+
algorithm: 'sha256',
|
292
|
+
user: 'steve'
|
293
|
+
};
|
294
|
+
|
295
|
+
var header = 'Hawk ts="1362346425875", tsm="hwayS28vtnn3qbv0mqRBYSXebN/zggEtucfeZ620Zo=", error="Stale timestamp"';
|
296
|
+
expect(Hawk.client.authenticate({ headers: { 'www-authenticate': header } }, credentials)).to.equal(false);
|
297
|
+
done();
|
298
|
+
});
|
299
|
+
|
300
|
+
it('skips tsm validation when missing ts', function (done) {
|
301
|
+
|
302
|
+
var header = 'Hawk error="Stale timestamp"';
|
303
|
+
expect(Hawk.client.authenticate({ headers: { 'www-authenticate': header } }, {})).to.equal(true);
|
304
|
+
done();
|
305
|
+
});
|
306
|
+
});
|
307
|
+
|
308
|
+
describe('message()', function () {
|
309
|
+
|
310
|
+
it('generates authorization', function (done) {
|
311
|
+
|
312
|
+
var credentials = {
|
313
|
+
id: '123456',
|
314
|
+
key: '2983d45yun89q',
|
315
|
+
algorithm: 'sha1'
|
316
|
+
};
|
317
|
+
|
318
|
+
var auth = Hawk.client.message('example.com', 80, 'I am the boodyman', { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
|
319
|
+
expect(auth).to.exist();
|
320
|
+
expect(auth.ts).to.equal(1353809207);
|
321
|
+
expect(auth.nonce).to.equal('abc123');
|
322
|
+
done();
|
323
|
+
});
|
324
|
+
|
325
|
+
it('errors on invalid host', function (done) {
|
326
|
+
|
327
|
+
var credentials = {
|
328
|
+
id: '123456',
|
329
|
+
key: '2983d45yun89q',
|
330
|
+
algorithm: 'sha1'
|
331
|
+
};
|
332
|
+
|
333
|
+
var auth = Hawk.client.message(5, 80, 'I am the boodyman', { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
|
334
|
+
expect(auth).to.not.exist();
|
335
|
+
done();
|
336
|
+
});
|
337
|
+
|
338
|
+
it('errors on invalid port', function (done) {
|
339
|
+
|
340
|
+
var credentials = {
|
341
|
+
id: '123456',
|
342
|
+
key: '2983d45yun89q',
|
343
|
+
algorithm: 'sha1'
|
344
|
+
};
|
345
|
+
|
346
|
+
var auth = Hawk.client.message('example.com', '80', 'I am the boodyman', { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
|
347
|
+
expect(auth).to.not.exist();
|
348
|
+
done();
|
349
|
+
});
|
350
|
+
|
351
|
+
it('errors on missing host', function (done) {
|
352
|
+
|
353
|
+
var credentials = {
|
354
|
+
id: '123456',
|
355
|
+
key: '2983d45yun89q',
|
356
|
+
algorithm: 'sha1'
|
357
|
+
};
|
358
|
+
|
359
|
+
var auth = Hawk.client.message('example.com', 0, 'I am the boodyman', { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
|
360
|
+
expect(auth).to.not.exist();
|
361
|
+
done();
|
362
|
+
});
|
363
|
+
|
364
|
+
it('errors on null message', function (done) {
|
365
|
+
|
366
|
+
var credentials = {
|
367
|
+
id: '123456',
|
368
|
+
key: '2983d45yun89q',
|
369
|
+
algorithm: 'sha1'
|
370
|
+
};
|
371
|
+
|
372
|
+
var auth = Hawk.client.message('example.com', 80, null, { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
|
373
|
+
expect(auth).to.not.exist();
|
374
|
+
done();
|
375
|
+
});
|
376
|
+
|
377
|
+
it('errors on missing message', function (done) {
|
378
|
+
|
379
|
+
var credentials = {
|
380
|
+
id: '123456',
|
381
|
+
key: '2983d45yun89q',
|
382
|
+
algorithm: 'sha1'
|
383
|
+
};
|
384
|
+
|
385
|
+
var auth = Hawk.client.message('example.com', 80, undefined, { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
|
386
|
+
expect(auth).to.not.exist();
|
387
|
+
done();
|
388
|
+
});
|
389
|
+
|
390
|
+
it('errors on invalid message', function (done) {
|
391
|
+
|
392
|
+
var credentials = {
|
393
|
+
id: '123456',
|
394
|
+
key: '2983d45yun89q',
|
395
|
+
algorithm: 'sha1'
|
396
|
+
};
|
397
|
+
|
398
|
+
var auth = Hawk.client.message('example.com', 80, 5, { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
|
399
|
+
expect(auth).to.not.exist();
|
400
|
+
done();
|
401
|
+
});
|
402
|
+
|
403
|
+
it('errors on missing options', function (done) {
|
404
|
+
|
405
|
+
var credentials = {
|
406
|
+
id: '123456',
|
407
|
+
key: '2983d45yun89q',
|
408
|
+
algorithm: 'sha1'
|
409
|
+
};
|
410
|
+
|
411
|
+
var auth = Hawk.client.message('example.com', 80, 'I am the boodyman');
|
412
|
+
expect(auth).to.not.exist();
|
413
|
+
done();
|
414
|
+
});
|
415
|
+
|
416
|
+
it('errors on invalid credentials (id)', function (done) {
|
417
|
+
|
418
|
+
var credentials = {
|
419
|
+
key: '2983d45yun89q',
|
420
|
+
algorithm: 'sha1'
|
421
|
+
};
|
422
|
+
|
423
|
+
var auth = Hawk.client.message('example.com', 80, 'I am the boodyman', { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
|
424
|
+
expect(auth).to.not.exist();
|
425
|
+
done();
|
426
|
+
});
|
427
|
+
|
428
|
+
it('errors on invalid credentials (key)', function (done) {
|
429
|
+
|
430
|
+
var credentials = {
|
431
|
+
id: '123456',
|
432
|
+
algorithm: 'sha1'
|
433
|
+
};
|
434
|
+
|
435
|
+
var auth = Hawk.client.message('example.com', 80, 'I am the boodyman', { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
|
436
|
+
expect(auth).to.not.exist();
|
437
|
+
done();
|
438
|
+
});
|
439
|
+
});
|
440
|
+
});
|