sign token with ports

This commit is contained in:
AJ ONeal 2018-06-14 17:05:26 -06:00
parent 9ea353f9a2
commit 05dd6d90e6
1 changed files with 8 additions and 2 deletions

View File

@ -28,7 +28,7 @@ if (-1 !== confIndex) {
confpath = confargs[1]; confpath = confargs[1];
} }
var updater = require('../lib/updater')(pkg); require('../lib/updater')(pkg);
function help() { function help() {
console.info(''); console.info('');
@ -646,7 +646,13 @@ function rawTunnel() {
if (!state.config.token && state.config.secret) { if (!state.config.token && state.config.secret) {
var jwt = require('jsonwebtoken'); var jwt = require('jsonwebtoken');
var tokenData = { var tokenData = {
domains: Object.keys(state.config.servernames || {}).filter(function (name) { return /\./.test(name); }) domains: Object.keys(state.config.servernames || {}).filter(function (name) {
return /\./.test(name);
})
, ports: Object.keys(state.config.ports || {}).filter(function (port) {
port = parseInt(port, 10);
return port > 0 && port <= 65535;
})
, aud: aud , aud: aud
, iss: Math.round(Date.now() / 1000) , iss: Math.round(Date.now() / 1000)
}; };