passport-tequila
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -0,1 +1,6 @@ | ||
# Version 1.0.4 | ||
- Fix tests not working on all OS | ||
- Switch example app to HTTPS (fixes error when getting back from Tequila) | ||
- Add npm scripts for example app and test with console debug output | ||
# Version 1.0.3 | ||
@@ -2,0 +7,0 @@ - Fix not letting the error(s) raise(s) when the HTTPSServer is created |
{ | ||
"name": "passport-tequila", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"private": false, | ||
"scripts": { | ||
"start": "node ./examples/express-passport/app.js", | ||
"test": "node_modules/mocha/bin/mocha --recursive test/tests" | ||
"start-debug": "cross-env DEBUG=passport-tequila:*,express-passport:* node ./examples/express-passport/app.js", | ||
"test": "mocha --recursive test/tests", | ||
"test-debug": "cross-env DEBUG=passport-tequila:* mocha --recursive test/tests" | ||
}, | ||
@@ -22,6 +24,7 @@ "engines": { | ||
"cookie-parser": "^1.4.3", | ||
"cross-env": "^7.0.3", | ||
"ejs": "^2.6.1", | ||
"express": "^4.16.3", | ||
"express-session": "^1.15.6", | ||
"fqdn": "0.0.3", | ||
"get-fqdn": "0.0.4", | ||
"ip": "^1.1.5", | ||
@@ -28,0 +31,0 @@ "method-override": "^2.3.10", |
@@ -10,3 +10,2 @@ 'use strict'; | ||
pem = require("pem"), | ||
ip = require("ip"), | ||
fs = require("fs"), | ||
@@ -41,3 +40,3 @@ EventEmitter = require("events").EventEmitter; | ||
this.opts = Object.assign({}, opts); | ||
if (opts.configFile) { | ||
if (opts && opts.configFile) { | ||
Object.assign(this.opts, JSON.parse(fs.readFileSync(opts.configFile))); | ||
@@ -105,3 +104,8 @@ } | ||
var auth_check = this.newKey(); | ||
this.state[key] = req.teqParams; | ||
this.state[key] = { | ||
url: req.url, | ||
method: req.method, | ||
headers: req.headers, | ||
teqParams: req.teqParams, | ||
}; | ||
respondWithDict(res, {key: key, auth_check: auth_check}); | ||
@@ -268,8 +272,7 @@ }; | ||
} | ||
var fqdn = require("fqdn"); | ||
fqdn(function(err, res) { | ||
if (err) return done(err); | ||
altNames.push(res); | ||
done(null, altNames); | ||
}); | ||
var fqdn = require("get-fqdn"); | ||
fqdn().then((res) => { | ||
altNames.push(res); | ||
done(null, altNames); | ||
}, done); | ||
} | ||
@@ -276,0 +279,0 @@ |
@@ -1,4 +0,3 @@ | ||
var chai = require('chai'), | ||
expect = chai.expect, | ||
Q = require('Q'), | ||
var expect = require('chai').expect, | ||
Q = require('q'), | ||
_ = require('underscore'), | ||
@@ -37,27 +36,33 @@ ip = require('ip'); | ||
it("serves on /cgi-bin/tequila/createrequest", function (done) { | ||
Q.nfcall(request.post, { | ||
url: 'https://localhost:' + server.port + | ||
"/cgi-bin/tequila/createrequest", | ||
body: "urlaccess=http://myhost.mydomain/myapp\n" + | ||
"request=name,firstname\n" + | ||
"require=group=somegroup\n" + | ||
"allows=category=guest" | ||
}) | ||
var host = "localhost:" + server.port; | ||
var url = "/cgi-bin/tequila/createrequest"; | ||
var body = "urlaccess=http://myhost.mydomain/myapp\n" + | ||
"request=name,firstname\n" + | ||
"require=group=somegroup\n" + | ||
"allows=category=guest"; | ||
Q.nfcall(request.post, { url: 'https://' + host + url, body }) | ||
.should.be.fulfilled.then(function (callbackArgs) { | ||
var res = callbackArgs[0], | ||
body = callbackArgs[1]; | ||
resBody = callbackArgs[1]; | ||
expect(res.statusCode).to.equal(200); | ||
var matched = String(body).match(/key=(.*)/); | ||
var matched = String(resBody).match(/key=(.*)/); | ||
expect(matched).to.be.an('Array'); | ||
var key = matched[1]; | ||
var expectedRequest = { | ||
urlaccess: "http://myhost.mydomain/myapp", | ||
request: "name,firstname", | ||
require: "group=somegroup", | ||
allows: "category=guest" | ||
}; | ||
expect(server.state).to.deep.equal( | ||
_.object([[key, expectedRequest]])); | ||
expect(server.state[matched[1]]).to.deep.equal({ | ||
url: url, | ||
method: 'POST', | ||
headers: { | ||
'connection': 'close', | ||
'content-length': String(body.length), | ||
'content-type': 'text/plain', | ||
'host': host, | ||
}, | ||
teqParams: { | ||
urlaccess: "http://myhost.mydomain/myapp", | ||
request: "name,firstname", | ||
require: "group=somegroup", | ||
allows: "category=guest", | ||
}, | ||
}); | ||
}).should.notify(done); | ||
}); | ||
}); |
var assert = require('assert'), | ||
chai = require('chai'), | ||
expect = chai.expect, | ||
chaiAsPromised = require('chai-as-promised'), | ||
Q = require('Q'), | ||
Q = require('q'), | ||
_ = require('underscore'); | ||
@@ -12,4 +11,3 @@ | ||
var Protocol = require('../../lib/passport-tequila/protocol.js'), | ||
fakes = require('../fakes'), | ||
request = fakes.request; | ||
fakes = require('../fakes'); | ||
@@ -16,0 +14,0 @@ describe("protocol.js", function() { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
39130
15
819
17