summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/request/node_modules/hawk/test/crypto.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/request/node_modules/hawk/test/crypto.js')
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/hawk/test/crypto.js110
1 files changed, 47 insertions, 63 deletions
diff --git a/deps/npm/node_modules/request/node_modules/hawk/test/crypto.js b/deps/npm/node_modules/request/node_modules/hawk/test/crypto.js
index f2d3d4580..1131628bf 100755
--- a/deps/npm/node_modules/request/node_modules/hawk/test/crypto.js
+++ b/deps/npm/node_modules/request/node_modules/hawk/test/crypto.js
@@ -18,69 +18,53 @@ var it = lab.test;
var expect = Code.expect;
-describe('Hawk', function () {
-
- describe('Crypto', function () {
-
- describe('#generateNormalizedString', function () {
-
- it('should return a valid normalized string', function (done) {
-
- expect(Hawk.crypto.generateNormalizedString('header', {
- credentials: {
- key: 'dasdfasdf',
- algorithm: 'sha256'
- },
- ts: 1357747017,
- nonce: 'k3k4j5',
- method: 'GET',
- resource: '/resource/something',
- host: 'example.com',
- port: 8080
- })).to.equal('hawk.1.header\n1357747017\nk3k4j5\nGET\n/resource/something\nexample.com\n8080\n\n\n');
-
- done();
- });
-
- it('should return a valid normalized string (ext)', function (done) {
-
- expect(Hawk.crypto.generateNormalizedString('header', {
- credentials: {
- key: 'dasdfasdf',
- algorithm: 'sha256'
- },
- ts: 1357747017,
- nonce: 'k3k4j5',
- method: 'GET',
- resource: '/resource/something',
- host: 'example.com',
- port: 8080,
- ext: 'this is some app data'
- })).to.equal('hawk.1.header\n1357747017\nk3k4j5\nGET\n/resource/something\nexample.com\n8080\n\nthis is some app data\n');
-
- done();
- });
-
- it('should return a valid normalized string (payload + ext)', function (done) {
-
- expect(Hawk.crypto.generateNormalizedString('header', {
- credentials: {
- key: 'dasdfasdf',
- algorithm: 'sha256'
- },
- ts: 1357747017,
- nonce: 'k3k4j5',
- method: 'GET',
- resource: '/resource/something',
- host: 'example.com',
- port: 8080,
- hash: 'U4MKKSmiVxk37JCCrAVIjV/OhB3y+NdwoCr6RShbVkE=',
- ext: 'this is some app data'
- })).to.equal('hawk.1.header\n1357747017\nk3k4j5\nGET\n/resource/something\nexample.com\n8080\nU4MKKSmiVxk37JCCrAVIjV/OhB3y+NdwoCr6RShbVkE=\nthis is some app data\n');
-
- done();
- });
+describe('Crypto', function () {
+
+ describe('generateNormalizedString()', function () {
+
+ it('should return a valid normalized string', function (done) {
+
+ expect(Hawk.crypto.generateNormalizedString('header', {
+ ts: 1357747017,
+ nonce: 'k3k4j5',
+ method: 'GET',
+ resource: '/resource/something',
+ host: 'example.com',
+ port: 8080
+ })).to.equal('hawk.1.header\n1357747017\nk3k4j5\nGET\n/resource/something\nexample.com\n8080\n\n\n');
+
+ done();
+ });
+
+ it('should return a valid normalized string (ext)', function (done) {
+
+ expect(Hawk.crypto.generateNormalizedString('header', {
+ ts: 1357747017,
+ nonce: 'k3k4j5',
+ method: 'GET',
+ resource: '/resource/something',
+ host: 'example.com',
+ port: 8080,
+ ext: 'this is some app data'
+ })).to.equal('hawk.1.header\n1357747017\nk3k4j5\nGET\n/resource/something\nexample.com\n8080\n\nthis is some app data\n');
+
+ done();
+ });
+
+ it('should return a valid normalized string (payload + ext)', function (done) {
+
+ expect(Hawk.crypto.generateNormalizedString('header', {
+ ts: 1357747017,
+ nonce: 'k3k4j5',
+ method: 'GET',
+ resource: '/resource/something',
+ host: 'example.com',
+ port: 8080,
+ hash: 'U4MKKSmiVxk37JCCrAVIjV/OhB3y+NdwoCr6RShbVkE=',
+ ext: 'this is some app data'
+ })).to.equal('hawk.1.header\n1357747017\nk3k4j5\nGET\n/resource/something\nexample.com\n8080\nU4MKKSmiVxk37JCCrAVIjV/OhB3y+NdwoCr6RShbVkE=\nthis is some app data\n');
+
+ done();
});
});
});
-