Socket
Socket
Sign inDemoInstall

hapi-auth-cookie

Package Overview
Dependencies
Maintainers
2
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-auth-cookie - npm Package Compare versions

Comparing version 3.0.1 to 3.1.0

2

example/index.js

@@ -90,3 +90,3 @@ var Hapi = require('hapi');

isSecure: false,
validateFunc: function (session, callback) {
validateFunc: function (request, session, callback) {

@@ -93,0 +93,0 @@ cache.get(session.sid, function (err, cached) {

@@ -25,3 +25,3 @@ // Load modules

cookie: Joi.string().default('sid'),
password: Joi.string().required(),
password: Joi.alternatives(Joi.string(), Joi.object().type(Buffer)).required(),
ttl: Joi.number().integer().min(0).when('keepAlive', { is: true, then: Joi.required() }),

@@ -28,0 +28,0 @@ domain: Joi.string().allow(null),

{
"name": "hapi-auth-cookie",
"description": "Cookie authentication plugin",
"version": "3.0.1",
"version": "3.1.0",
"repository": "git://github.com/hapijs/hapi-auth-cookie",

@@ -6,0 +6,0 @@ "main": "lib/index.js",

@@ -58,2 +58,19 @@ // Load modules

it('passes with a password configured which is a Buffer', function (done) {
var server = new Hapi.Server();
server.connection();
server.register(require('../'), function (err) {
expect(err).to.not.exist();
expect(function () {
server.auth.strategy('default', 'cookie', true, { password: new Buffer('foobar') });
}).to.not.throw();
done();
});
});
it('fails if validateFunc is not a function', function (done) {

@@ -147,2 +164,3 @@

/* eslint-disable hapi/no-shadow-relaxed */
server.inject({ method: 'GET', url: '/resource', headers: { cookie: 'special=' + cookie[1] } }, function (res) {

@@ -155,2 +173,3 @@

});
/* eslint-enable hapi/no-shadow-relaxed */
});

@@ -298,2 +317,3 @@ });

/* eslint-disable hapi/no-shadow-relaxed */
server.inject({ method: 'GET', url: '/logout', headers: { cookie: 'special=' + cookie[1] } }, function (res) {

@@ -306,2 +326,3 @@

});
/* eslint-enable hapi/no-shadow-relaxed */
});

@@ -362,2 +383,3 @@ });

/* eslint-disable hapi/no-shadow-relaxed */
server.inject({ method: 'GET', url: '/resource', headers: { cookie: 'special=' + cookie[1] } }, function (res) {

@@ -369,2 +391,3 @@

});
/* eslint-enable hapi/no-shadow-relaxed */
});

@@ -424,2 +447,3 @@ });

/* eslint-disable hapi/no-shadow-relaxed */
server.inject({ method: 'GET', url: '/resource', headers: { cookie: 'special=' + cookie[1] } }, function (res) {

@@ -431,2 +455,3 @@

});
/* eslint-enable hapi/no-shadow-relaxed */
});

@@ -479,2 +504,3 @@ });

/* eslint-disable hapi/no-shadow-relaxed */
server.inject({ method: 'GET', url: '/resource', headers: { cookie: 'special=' + cookie[1] } }, function (res) {

@@ -486,2 +512,3 @@

});
/* eslint-enable hapi/no-shadow-relaxed */
});

@@ -530,2 +557,3 @@ });

/* eslint-disable hapi/no-shadow-relaxed */
server.inject('/login/steve', function (res) {

@@ -545,2 +573,3 @@

});
/* eslint-enable hapi/no-shadow-relaxed */
});

@@ -643,2 +672,3 @@ });

/* eslint-disable hapi/no-shadow-relaxed */
server.inject({ method: 'GET', url: '/resource', headers: { cookie: 'special=' + cookie[1] } }, function (res) {

@@ -650,2 +680,3 @@

});
/* eslint-enable hapi/no-shadow-relaxed */
});

@@ -704,2 +735,3 @@ });

/* eslint-disable hapi/no-shadow-relaxed */
server.inject({ method: 'GET', url: '/subpath/resource', headers: { cookie: 'special=' + cookie[1] } }, function (res) {

@@ -711,2 +743,3 @@

});
/* eslint-enable hapi/no-shadow-relaxed */
});

@@ -759,2 +792,3 @@ });

/* eslint-disable hapi/no-shadow-relaxed */
server.inject({ method: 'GET', url: '/resource', headers: { cookie: 'special=' + cookie[1] } }, function (res) {

@@ -768,2 +802,3 @@

});
/* eslint-enable hapi/no-shadow-relaxed */
});

@@ -825,2 +860,3 @@ });

/* eslint-disable hapi/no-shadow-relaxed */
server.inject({ method: 'GET', url: '/resource', headers: { cookie: 'special=' + cookie[1] } }, function (res) {

@@ -836,2 +872,3 @@

});
/* eslint-enable hapi/no-shadow-relaxed */
});

@@ -928,2 +965,3 @@ });

/* eslint-disable hapi/no-shadow-relaxed */
server.inject({ method: 'GET', url: '/setKey', headers: { cookie: 'special=' + cookie[1] } }, function (res) {

@@ -933,2 +971,3 @@

});
/* eslint-enable hapi/no-shadow-relaxed */
});

@@ -1108,2 +1147,3 @@ });

/* eslint-disable hapi/no-shadow-relaxed */
server.inject({ method: 'GET', url: '/clearKey', headers: { cookie: 'special=' + cookie[1] } }, function (res) {

@@ -1113,2 +1153,3 @@

});
/* eslint-enable hapi/no-shadow-relaxed */
});

@@ -1289,2 +1330,3 @@ });

/* eslint-disable hapi/no-shadow-relaxed */
server.inject({ method: 'GET', url: '/ttl', headers: { cookie: 'special=' + cookie[1] } }, function (res) {

@@ -1294,2 +1336,3 @@

});
/* eslint-enable hapi/no-shadow-relaxed */
});

@@ -1296,0 +1339,0 @@ });

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc