fix: pkg upgrades and small fixes

This commit is contained in:
simon 2021-05-28 12:33:26 +02:00
parent 4af6eded3d
commit 5290ac37c0
5 changed files with 2407 additions and 4538 deletions

6888
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -29,7 +29,9 @@ const { argv } = yargs
.alias('s', 'secret') .alias('s', 'secret')
.describe('secret', 'RADIUS secret') .describe('secret', 'RADIUS secret')
.number('port') .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(`Listener Port: ${argv.port || 1812}`);
console.log(`RADIUS Secret: ${argv.secret}`); console.log(`RADIUS Secret: ${argv.secret}`);

View File

@ -49,7 +49,7 @@ export class SMTPAuth implements IAuthentication {
tlsOptions: { tlsOptions: {
servername: this.host, // SNI (needs to be set for gmail) 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; let success = false;
try { try {

View File

@ -14,7 +14,12 @@ export class UserPasswordPacketHandler implements IPacketHandler {
async handlePacket(packet: IPacket): Promise<IPacketHandlerResult> { async handlePacket(packet: IPacket): Promise<IPacketHandlerResult> {
const username = packet.attributes['User-Name']; 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) { if (!username || !password) {
// params missing, this handler cannot continue... // params missing, this handler cannot continue...