passport-tequila
Advanced tools
Comparing version 0.1.16 to 0.2.0-pre
{ | ||
"name": "passport-tequila", | ||
"version": "0.1.16", | ||
"version": "0.2.0pre", | ||
"private": false, | ||
@@ -9,2 +9,5 @@ "scripts": { | ||
}, | ||
"engines": { | ||
"node": ">= 14" | ||
}, | ||
"dependencies": { | ||
@@ -26,3 +29,3 @@ "debug": "^2.6.9", | ||
"method-override": "^2.3.10", | ||
"mocha": "^5.2.0", | ||
"mocha": "^9.0.3", | ||
"morgan": "^1.9.1", | ||
@@ -42,6 +45,6 @@ "pem": "^1.14.3", | ||
"type": "git", | ||
"url": "git://github.com/epfl-si/passport-tequila.git" | ||
"url": "git@gitlab.com:epfl-idevfsd/passport-tequila.git" | ||
}, | ||
"bugs": { | ||
"url": "http://github.com/epfl-si/passport-tequila/issues" | ||
"url": "https://gitlab.com/epfl-idevfsd/passport-tequila/-/issues" | ||
}, | ||
@@ -48,0 +51,0 @@ "license": "MIT", |
@@ -22,3 +22,3 @@ # Passport-Tequila | ||
See [the express and passport demo | ||
app](https://github.com/epfl-si/passport-tequila/tree/master/examples/express-passport) | ||
app](https://gitlab.com/epfl-idevfsd/passport-tequila/-/tree/master/examples) | ||
for a working example (requires a Tequila server in your domain, which | ||
@@ -25,0 +25,0 @@ means it is most likely to work from inside EPFL). |
'use strict'; | ||
// Note: because getOptions() is useful also for an out-of-process server, | ||
// this file ought to remain useful (loadable) even if the dev dependencies | ||
// are not available. | ||
var https = require("https"), | ||
@@ -41,3 +38,7 @@ express = require("express"), | ||
*/ | ||
var TequilaServer = exports.TequilaServer = function() { | ||
var TequilaServer = exports.TequilaServer = function(opts) { | ||
this.opts = Object.assign({}, opts); | ||
if (opts.configFile) { | ||
Object.assign(this.opts, JSON.parse(fs.readFileSync(opts.configFile))); | ||
} | ||
this.state = {}; | ||
@@ -107,17 +108,34 @@ var app = this.app = express(); | ||
TequilaServer.prototype.do_requestauth = function(req, res, next) { | ||
res.send("<html>\n" + | ||
"<head>\n" + | ||
"<title>Fake Tequila Server</title></head>\n" + | ||
"<body>\n" + | ||
"<h1>Fake Tequila Server</h1>" + | ||
"<p>Whom would you like to impersonate today?</p>" + | ||
"<form action='/requestauth_submit' method='GET'>\n" + | ||
"<input type='hidden' id='requestkey' name='requestkey' " + | ||
" value='" + req.query.requestkey + "'>\n" + | ||
"<label for='uniqueid'>SCIPER:</label>" + | ||
"<input type='text' id='uniqueid' name='uniqueid' value='243371'><br/>\n" + | ||
"<label for='displayname'>Display name:</label>" + | ||
"<input type='text' id='displayname' name='displayname' value='Dominique Quatravaux'><br/>\n" + | ||
"<input type='submit'>\n" + | ||
"</form></body></html>\n"); | ||
const opts = this.opts | ||
res.send(`<html> | ||
<head> | ||
<title>Fake Tequila Server</title></head> | ||
<body> | ||
<h1>Fake Tequila Server</h1> | ||
<p>Whom would you like to impersonate today?</p> | ||
<form action="/requestauth_submit" method="GET"> | ||
<input type="hidden" id="requestkey" name="requestkey" | ||
value="${req.query.requestkey}"> | ||
<label for="uniqueid">SCIPER:</label> | ||
<input type="text" id="uniqueid" name="uniqueid" ${opt2value("uniqueid")}><br/> | ||
<label for="displayname">Display name:</label> | ||
<input type="text" id="displayname" name="displayname" ${opt2value("displayname")}><br/> | ||
<label for="group">Groups (comma separated):</label> | ||
<input type="text" id="group" name="group" ${opt2value("group")}><br/> | ||
<input type="submit"> | ||
</form> | ||
</body> | ||
</html> | ||
`); | ||
function opt2value(optName) { | ||
if (opts.requestauth) { | ||
return `value="${opts.requestauth[optName]}"` | ||
} else if (opts.configFile) { | ||
return `placeholder="Set default in ${opts.configFile}"` | ||
} else { | ||
return "" | ||
} | ||
} | ||
}; | ||
@@ -131,3 +149,4 @@ | ||
uniqueid: req.query.uniqueid, | ||
displayname: req.query.displayname | ||
displayname: req.query.displayname, | ||
group: req.query.group, | ||
}; | ||
@@ -134,0 +153,0 @@ var urlaccess = this.state[req.query.requestkey].urlaccess; |
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
787
0
36606
3