fix: pkg upgrades and small fixes

master
simon 3 years ago
parent 4af6eded3d
commit 5290ac37c0

9436
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -30,32 +30,32 @@
"preferGlobal": true,
"main": "dist/app.js",
"dependencies": {
"@hokify/node-ts-cache": "^5.4.1",
"@hokify/node-ts-cache": "^5.5.1",
"axios": "^0.21.1",
"debug": "^4.3.1",
"imap-simple": "^5.0.0",
"ldapauth-fork": "^5.0.1",
"ldapjs": "^2.2.3",
"ldapjs": "^2.3.0",
"native-duplexpair": "^1.0.0",
"node-cache": "^5.1.2",
"radius": "~1.1.4",
"smtp-client": "^0.3.3",
"yargs": "~16.2.0"
"smtp-client": "^0.4.0",
"yargs": "~17.0.1"
},
"license": "GPLv3",
"devDependencies": {
"@hokify/eslint-config": "^1.1.0",
"@types/chai": "^4.2.14",
"@types/ldapjs": "^1.0.9",
"@types/mocha": "^8.2.0",
"@hokify/eslint-config": "^2.0.14",
"@types/chai": "^4.2.18",
"@types/ldapjs": "^1.0.10",
"@types/mocha": "^8.2.2",
"@types/radius": "0.0.28",
"@types/yargs": "^15.0.12",
"chai": "^4.2.0",
"eslint": "^7.18.0",
"mocha": "^8.2.1",
"prettier": "^2.2.1",
"standard-version": "^9.1.0",
"ts-node": "^9.1.1",
"typescript": "^4.1.3"
"@types/yargs": "^17.0.0",
"chai": "^4.3.4",
"eslint": "^7.27.0",
"mocha": "^8.4.0",
"prettier": "^2.3.0",
"standard-version": "^9.3.0",
"ts-node": "^10.0.0",
"typescript": "^4.3.2"
}
}

@ -29,7 +29,9 @@ const { argv } = yargs
.alias('s', 'secret')
.describe('secret', 'RADIUS secret')
.number('port')
.string(['secret', 'authentication']);
.string(['secret', 'authentication']) as {
argv: { port?: number; secret?: string; authentication?: string; authenticationOptions?: any };
};
console.log(`Listener Port: ${argv.port || 1812}`);
console.log(`RADIUS Secret: ${argv.secret}`);

@ -49,7 +49,7 @@ export class SMTPAuth implements IAuthentication {
tlsOptions: {
servername: this.host, // SNI (needs to be set for gmail)
},
});
} as any); // secure is currently not part of type def..but it is available: https://www.npmjs.com/package/smtp-client
let success = false;
try {

@ -14,7 +14,12 @@ export class UserPasswordPacketHandler implements IPacketHandler {
async handlePacket(packet: IPacket): Promise<IPacketHandlerResult> {
const username = packet.attributes['User-Name'];
const password = packet.attributes['User-Password'];
let password = packet.attributes['User-Password'];
if (typeof password !== 'string' && password.indexOf(0x00) > 0) {
// check if there is a 0x00 in it, and trim it from there
password = password.slice(0, password.indexOf(0x00));
}
if (!username || !password) {
// params missing, this handler cannot continue...

Loading…
Cancel
Save