@iobroker/js-controller-common
Advanced tools
Comparing version 4.0.0-alpha.9-20211102-d892122d to 4.0.0-alpha.9-20211115-5dac659e
@@ -7,12 +7,12 @@ /* jshint -W097 */ | ||
const winston = require('winston'); | ||
const DailyRotateFile = require('winston-daily-rotate-file'); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const os = require('os'); | ||
const tools = require('./tools'); | ||
const hostname = tools.getHostName(); | ||
const Transport = require('winston-transport'); | ||
const {LEVEL} = require('triple-beam'); | ||
const deepClone = require('deep-clone'); | ||
const winston = require('winston'); | ||
const DailyRotateFile = require('winston-daily-rotate-file'); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const os = require('os'); | ||
const tools = require('./tools'); | ||
const hostname = tools.getHostName(); | ||
const Transport = require('winston-transport'); | ||
const {LEVEL} = require('triple-beam'); | ||
const deepClone = require('deep-clone'); | ||
@@ -19,0 +19,0 @@ let SysLog; |
@@ -5,3 +5,3 @@ /** | ||
* | ||
* 7'2014-2016 Bluefox <dogafox@gmail.com> | ||
* 7'2014-2021 Bluefox <dogafox@gmail.com> | ||
* 2014 hobbyquaker <hq@ccu.io> | ||
@@ -85,13 +85,21 @@ * | ||
this.hash(key[3], parseInt(key[1], 10), function (error, newHash) { | ||
this.hash(key[3], parseInt(key[1], 10), (error, newHash) => { | ||
if (error) { | ||
return callback(error); | ||
callback(error); | ||
} else { | ||
callback(null, newHash === hashedPassword); | ||
} | ||
callback(null, newHash === hashedPassword); | ||
}); | ||
}, | ||
complexity: _callback => { | ||
// Todo: Check for password complexity | ||
return true; | ||
complexity: (password, callback) => { | ||
let result = false; | ||
if (typeof password === 'string') { | ||
result = | ||
password.length >= 8 && // minimum length is 8 | ||
password.match(/\d/) && // contains at least one digit | ||
password.match(/[a-z]/) && // contains at least one lower case letter | ||
password.match(/[A-Z]/); // contains at least one upper case letter | ||
} | ||
typeof callback === 'function' && callback(result); | ||
return result; // true if the complexity OK | ||
} | ||
@@ -101,2 +109,2 @@ }; | ||
module.exports = password; | ||
module.exports = password; |
{ | ||
"name": "@iobroker/js-controller-common", | ||
"version": "4.0.0-alpha.9-20211102-d892122d", | ||
"version": "4.0.0-alpha.9-20211115-5dac659e", | ||
"engines": { | ||
@@ -49,3 +49,3 @@ "node": ">=12.0.0" | ||
], | ||
"gitHead": "c1934b1801ee5253170a49ebd04aaf8a50dc05cb" | ||
"gitHead": "fe67b6f4f17e34f417ec8b4a11a57a107124c475" | ||
} |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
142382
3518