From bb79aa5a893a383f266e3e7e4046dfc50d55a4e7 Mon Sep 17 00:00:00 2001 From: HumbertoDiego Date: Wed, 9 Nov 2022 19:33:27 -0400 Subject: [PATCH 1/7] add ldap-async --- client/package-lock.json | 34 +- package-lock.json | 652 ++++++++++++--------------------------- server/package-lock.json | 248 +++++++++++++++ server/package.json | 3 +- 4 files changed, 473 insertions(+), 464 deletions(-) diff --git a/client/package-lock.json b/client/package-lock.json index 77cbb46..6b5d959 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -5091,6 +5091,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ansi-html": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/ansi-html/-/ansi-html-0.0.7.tgz", @@ -21607,9 +21618,11 @@ } }, "node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", + "optional": true, + "peer": true, "engines": { "node": ">=10" }, @@ -27499,6 +27512,13 @@ "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "requires": { "type-fest": "^0.21.3" + }, + "dependencies": { + "type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==" + } } }, "ansi-html": { @@ -40249,9 +40269,11 @@ "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==" }, "type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==" + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", + "optional": true, + "peer": true }, "type-is": { "version": "1.6.18", diff --git a/package-lock.json b/package-lock.json index acce91c..55a5b3b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "commander": "^9.3.0", "concurrently": "^7.2.2", "fs-extra": "^10.1.0", - "inquirer": "^9.0.0", + "inquirer": "8.2.2", "npm-run": "^5.0.1", "pg-promise": "^10.11.1", "pm2": "^5.2.0" @@ -275,28 +275,25 @@ } }, "node_modules/ansi-escapes": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-5.0.0.tgz", - "integrity": "sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dependencies": { - "type-fest": "^1.0.2" + "type-fest": "^0.21.3" }, "engines": { - "node": ">=12" + "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" + "node": ">=8" } }, "node_modules/ansi-styles": { @@ -428,11 +425,11 @@ } }, "node_modules/bl": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-5.0.0.tgz", - "integrity": "sha512-8vxFNZ0pflFfi0WXA3WQXlj6CaMEwsmh63I1CNp0q+wWv8sD0ARx1KovSQd0l2GkwrMIOyedq0EF1FxI+RCZLQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", "dependencies": { - "buffer": "^6.0.3", + "buffer": "^5.5.0", "inherits": "^2.0.4", "readable-stream": "^3.4.0" } @@ -479,9 +476,9 @@ } }, "node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "funding": [ { "type": "github", @@ -498,7 +495,7 @@ ], "dependencies": { "base64-js": "^1.3.1", - "ieee754": "^1.2.1" + "ieee754": "^1.1.13" } }, "node_modules/buffer-from": { @@ -579,23 +576,20 @@ } }, "node_modules/cli-cursor": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", - "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "dependencies": { - "restore-cursor": "^4.0.0" + "restore-cursor": "^3.1.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, "node_modules/cli-spinners": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz", - "integrity": "sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.7.0.tgz", + "integrity": "sha512-qu3pN8Y3qHNgE2AFweciB1IfMnmZ/fsNTEE+NOFjmGB2F/7rLhnhzppvpCnN4FovtP26k8lHyy9ptEbNwWFLzw==", "engines": { "node": ">=6" }, @@ -638,11 +632,11 @@ } }, "node_modules/cli-width": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.0.0.tgz", - "integrity": "sha512-ZksGS2xpa/bYkNzN3BAw1wEjsLV/ZKOf/CCrJ/QOBsxx6fOARIkwTutxp1XIOIohi6HKmOFjMoK/XaqDVUpEEw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", "engines": { - "node": ">= 12" + "node": ">= 10" } }, "node_modules/cliui": { @@ -655,43 +649,6 @@ "wrap-ansi": "^7.0.0" } }, - "node_modules/cliui/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "node_modules/cliui/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/cliui/node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -846,11 +803,14 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" }, "node_modules/defaults": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", - "integrity": "sha512-s82itHOnYrN0Ib8r+z7laQz3sdE+4FP3d9Q7VLO7U+KRT+CR0GsWuyHxzdAY82I7cXv0G/twrqomTJLOssO5HA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", "dependencies": { "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/degenerator": { @@ -875,11 +835,6 @@ "node": ">= 0.6" } }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" - }, "node_modules/emitter-listener": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/emitter-listener/-/emitter-listener-1.1.2.tgz", @@ -889,9 +844,9 @@ } }, "node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "node_modules/enquirer": { "version": "2.3.6", @@ -913,14 +868,11 @@ } }, "node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=0.8.0" } }, "node_modules/escodegen": { @@ -1006,15 +958,14 @@ "integrity": "sha1-EOhdo4v+p/xZk0HClu4ddyZu5kA=" }, "node_modules/figures": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/figures/-/figures-4.0.1.tgz", - "integrity": "sha512-rElJwkA/xS04Vfg+CaZodpso7VqBknOYbzi6I76hI4X80RUjkSxO2oAyPmGbuXUppywjqndOrQDl817hDnI++w==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "dependencies": { - "escape-string-regexp": "^5.0.0", - "is-unicode-supported": "^1.2.0" + "escape-string-regexp": "^1.0.5" }, "engines": { - "node": ">=12" + "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -1329,41 +1280,29 @@ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" }, "node_modules/inquirer": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-9.0.0.tgz", - "integrity": "sha512-eYTDdTYr/YPwRenOzLZTvaJUDXDW8GQgxvzBppuXLj/kauTRLfV8bCPVbGh2staP7edrqL+rGwjaOa+JVxBWsg==", - "dependencies": { - "ansi-escapes": "^5.0.0", - "chalk": "^5.0.1", - "cli-cursor": "^4.0.0", - "cli-width": "^4.0.0", + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.2.tgz", + "integrity": "sha512-pG7I/si6K/0X7p1qU+rfWnpTE1UIkTONN1wxtzh0d+dHXtT/JG6qBgLxoyHVsQa8cFABxAPh0pD6uUUHiAoaow==", + "dependencies": { + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.1", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", "external-editor": "^3.0.3", - "figures": "^4.0.1", + "figures": "^3.0.0", "lodash": "^4.17.21", "mute-stream": "0.0.8", - "ora": "^6.1.0", + "ora": "^5.4.1", "run-async": "^2.4.0", "rxjs": "^7.5.5", - "string-width": "^5.1.2", - "strip-ansi": "^7.0.1", - "through": "^2.3.6", - "wrap-ansi": "^8.0.1" + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6" }, "engines": { "node": ">=12.0.0" } }, - "node_modules/inquirer/node_modules/chalk": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", - "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==", - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, "node_modules/ip": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", @@ -1419,14 +1358,11 @@ } }, "node_modules/is-interactive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", - "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, "node_modules/is-number": { @@ -1438,11 +1374,11 @@ } }, "node_modules/is-unicode-supported": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.2.0.tgz", - "integrity": "sha512-wH+U77omcRzevfIG8dDhTS0V9zZyweakfD01FULl97+0EHiJTTZtJqxPSkIIo/SDPv/i07k/C9jAPY+jwLLeUQ==", + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "engines": { - "node": ">=12" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -1520,31 +1456,20 @@ } }, "node_modules/log-symbols": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.1.0.tgz", - "integrity": "sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dependencies": { - "chalk": "^5.0.0", - "is-unicode-supported": "^1.1.0" + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" }, "engines": { - "node": ">=12" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/log-symbols/node_modules/chalk": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", - "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==", - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, "node_modules/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", @@ -1751,38 +1676,27 @@ } }, "node_modules/ora": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/ora/-/ora-6.1.2.tgz", - "integrity": "sha512-EJQ3NiP5Xo94wJXIzAyOtSb0QEIAUu7m8t6UZ9krbz0vAJqr92JpcK/lEXg91q6B9pEGqrykkd2EQplnifDSBw==", - "dependencies": { - "bl": "^5.0.0", - "chalk": "^5.0.0", - "cli-cursor": "^4.0.0", - "cli-spinners": "^2.6.1", - "is-interactive": "^2.0.0", - "is-unicode-supported": "^1.1.0", - "log-symbols": "^5.1.0", - "strip-ansi": "^7.0.1", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "dependencies": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", "wcwidth": "^1.0.1" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ora/node_modules/chalk": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", - "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==", - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, "node_modules/os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", @@ -2280,18 +2194,15 @@ } }, "node_modules/restore-cursor": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", - "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "dependencies": { "onetime": "^5.1.0", "signal-exit": "^3.0.2" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, "node_modules/run-async": { @@ -2511,33 +2422,27 @@ } }, "node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, "node_modules/strip-ansi": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", - "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dependencies": { - "ansi-regex": "^6.0.1" + "ansi-regex": "^5.0.1" }, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" + "node": ">=8" } }, "node_modules/supports-color": { @@ -2656,9 +2561,9 @@ } }, "node_modules/type-fest": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", - "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "engines": { "node": ">=10" }, @@ -2760,33 +2665,6 @@ "node": ">=0.10.0" } }, - "node_modules/wrap-ansi": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.0.1.tgz", - "integrity": "sha512-QFF+ufAqhoYHvoHdajT/Po7KoXVBPXS2bgjIam5isfWJPfIOnQZ50JtUiVvCv/sjgacf3yRrt2ZKUZ/V4itN4g==", - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.1.0.tgz", - "integrity": "sha512-VbqNsoz55SYGczauuup0MFUyXNQviSpFTj1RQtFzmQLk18qbVSpTFFGMT293rmDaQuKCT6InmbuEyUne4mTuxQ==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -2878,43 +2756,6 @@ "engines": { "node": ">=12" } - }, - "node_modules/yargs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "node_modules/yargs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } } }, "dependencies": { @@ -3128,17 +2969,17 @@ "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==" }, "ansi-escapes": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-5.0.0.tgz", - "integrity": "sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "requires": { - "type-fest": "^1.0.2" + "type-fest": "^0.21.3" } }, "ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==" + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" }, "ansi-styles": { "version": "4.3.0", @@ -3235,11 +3076,11 @@ "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==" }, "bl": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-5.0.0.tgz", - "integrity": "sha512-8vxFNZ0pflFfi0WXA3WQXlj6CaMEwsmh63I1CNp0q+wWv8sD0ARx1KovSQd0l2GkwrMIOyedq0EF1FxI+RCZLQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", "requires": { - "buffer": "^6.0.3", + "buffer": "^5.5.0", "inherits": "^2.0.4", "readable-stream": "^3.4.0" } @@ -3277,12 +3118,12 @@ } }, "buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "requires": { "base64-js": "^1.3.1", - "ieee754": "^1.2.1" + "ieee754": "^1.1.13" } }, "buffer-from": { @@ -3345,17 +3186,17 @@ } }, "cli-cursor": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", - "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "requires": { - "restore-cursor": "^4.0.0" + "restore-cursor": "^3.1.0" } }, "cli-spinners": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz", - "integrity": "sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==" + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.7.0.tgz", + "integrity": "sha512-qu3pN8Y3qHNgE2AFweciB1IfMnmZ/fsNTEE+NOFjmGB2F/7rLhnhzppvpCnN4FovtP26k8lHyy9ptEbNwWFLzw==" }, "cli-tableau": { "version": "2.0.1", @@ -3385,9 +3226,9 @@ } }, "cli-width": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.0.0.tgz", - "integrity": "sha512-ZksGS2xpa/bYkNzN3BAw1wEjsLV/ZKOf/CCrJ/QOBsxx6fOARIkwTutxp1XIOIohi6HKmOFjMoK/XaqDVUpEEw==" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==" }, "cliui": { "version": "7.0.4", @@ -3399,34 +3240,6 @@ "wrap-ansi": "^7.0.0" }, "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "requires": { - "ansi-regex": "^5.0.1" - } - }, "wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -3541,9 +3354,9 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" }, "defaults": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", - "integrity": "sha512-s82itHOnYrN0Ib8r+z7laQz3sdE+4FP3d9Q7VLO7U+KRT+CR0GsWuyHxzdAY82I7cXv0G/twrqomTJLOssO5HA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", "requires": { "clone": "^1.0.2" } @@ -3564,11 +3377,6 @@ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" }, - "eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" - }, "emitter-listener": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/emitter-listener/-/emitter-listener-1.1.2.tgz", @@ -3578,9 +3386,9 @@ } }, "emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "enquirer": { "version": "2.3.6", @@ -3596,9 +3404,9 @@ "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" }, "escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==" + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==" }, "escodegen": { "version": "1.14.3", @@ -3658,12 +3466,11 @@ "integrity": "sha1-EOhdo4v+p/xZk0HClu4ddyZu5kA=" }, "figures": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/figures/-/figures-4.0.1.tgz", - "integrity": "sha512-rElJwkA/xS04Vfg+CaZodpso7VqBknOYbzi6I76hI4X80RUjkSxO2oAyPmGbuXUppywjqndOrQDl817hDnI++w==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "requires": { - "escape-string-regexp": "^5.0.0", - "is-unicode-supported": "^1.2.0" + "escape-string-regexp": "^1.0.5" } }, "file-uri-to-path": { @@ -3893,32 +3700,24 @@ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" }, "inquirer": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-9.0.0.tgz", - "integrity": "sha512-eYTDdTYr/YPwRenOzLZTvaJUDXDW8GQgxvzBppuXLj/kauTRLfV8bCPVbGh2staP7edrqL+rGwjaOa+JVxBWsg==", + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.2.tgz", + "integrity": "sha512-pG7I/si6K/0X7p1qU+rfWnpTE1UIkTONN1wxtzh0d+dHXtT/JG6qBgLxoyHVsQa8cFABxAPh0pD6uUUHiAoaow==", "requires": { - "ansi-escapes": "^5.0.0", - "chalk": "^5.0.1", - "cli-cursor": "^4.0.0", - "cli-width": "^4.0.0", + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.1", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", "external-editor": "^3.0.3", - "figures": "^4.0.1", + "figures": "^3.0.0", "lodash": "^4.17.21", "mute-stream": "0.0.8", - "ora": "^6.1.0", + "ora": "^5.4.1", "run-async": "^2.4.0", "rxjs": "^7.5.5", - "string-width": "^5.1.2", - "strip-ansi": "^7.0.1", - "through": "^2.3.6", - "wrap-ansi": "^8.0.1" - }, - "dependencies": { - "chalk": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", - "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==" - } + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6" } }, "ip": { @@ -3961,9 +3760,9 @@ } }, "is-interactive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", - "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==" }, "is-number": { "version": "7.0.0", @@ -3971,9 +3770,9 @@ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" }, "is-unicode-supported": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.2.0.tgz", - "integrity": "sha512-wH+U77omcRzevfIG8dDhTS0V9zZyweakfD01FULl97+0EHiJTTZtJqxPSkIIo/SDPv/i07k/C9jAPY+jwLLeUQ==" + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==" }, "isarray": { "version": "0.0.1", @@ -4036,19 +3835,12 @@ "integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==" }, "log-symbols": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.1.0.tgz", - "integrity": "sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "requires": { - "chalk": "^5.0.0", - "is-unicode-supported": "^1.1.0" - }, - "dependencies": { - "chalk": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", - "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==" - } + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" } }, "lru-cache": { @@ -4209,26 +4001,19 @@ } }, "ora": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/ora/-/ora-6.1.2.tgz", - "integrity": "sha512-EJQ3NiP5Xo94wJXIzAyOtSb0QEIAUu7m8t6UZ9krbz0vAJqr92JpcK/lEXg91q6B9pEGqrykkd2EQplnifDSBw==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", "requires": { - "bl": "^5.0.0", - "chalk": "^5.0.0", - "cli-cursor": "^4.0.0", - "cli-spinners": "^2.6.1", - "is-interactive": "^2.0.0", - "is-unicode-supported": "^1.1.0", - "log-symbols": "^5.1.0", - "strip-ansi": "^7.0.1", + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", "wcwidth": "^1.0.1" - }, - "dependencies": { - "chalk": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", - "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==" - } } }, "os-tmpdir": { @@ -4615,9 +4400,9 @@ } }, "restore-cursor": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", - "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "requires": { "onetime": "^5.1.0", "signal-exit": "^3.0.2" @@ -4782,21 +4567,21 @@ } }, "string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "requires": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" } }, "strip-ansi": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", - "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "requires": { - "ansi-regex": "^6.0.1" + "ansi-regex": "^5.0.1" } }, "supports-color": { @@ -4872,9 +4657,9 @@ } }, "type-fest": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", - "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==" + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==" }, "universalify": { "version": "2.0.0", @@ -4947,23 +4732,6 @@ "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==" }, - "wrap-ansi": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.0.1.tgz", - "integrity": "sha512-QFF+ufAqhoYHvoHdajT/Po7KoXVBPXS2bgjIam5isfWJPfIOnQZ50JtUiVvCv/sjgacf3yRrt2ZKUZ/V4itN4g==", - "requires": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "dependencies": { - "ansi-styles": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.1.0.tgz", - "integrity": "sha512-VbqNsoz55SYGczauuup0MFUyXNQviSpFTj1RQtFzmQLk18qbVSpTFFGMT293rmDaQuKCT6InmbuEyUne4mTuxQ==" - } - } - }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -5016,36 +4784,6 @@ "string-width": "^4.2.3", "y18n": "^5.0.5", "yargs-parser": "^21.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "requires": { - "ansi-regex": "^5.0.1" - } - } } }, "yargs-parser": { diff --git a/server/package-lock.json b/server/package-lock.json index 4290110..bfc4fc7 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -23,6 +23,7 @@ "joi": "^17.6.0", "jsdoc": "^3.6.10", "jsonwebtoken": "^8.5.1", + "ldap-async": "^1.3.3", "minimist": "^1.2.6", "nocache": "^3.0.4", "nodemon": "^2.0.18", @@ -743,6 +744,14 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, + "node_modules/@types/ldapjs": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@types/ldapjs/-/ldapjs-2.2.5.tgz", + "integrity": "sha512-Lv/nD6QDCmcT+V1vaTRnEKE8UgOilVv5pHcQuzkU1LcRe4mbHHuUo/KHi0LKrpdHhQY8FJzryF38fcVdeUIrzg==", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/linkify-it": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.2.tgz", @@ -775,6 +784,11 @@ "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.1.tgz", "integrity": "sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==" }, + "node_modules/@types/node": { + "version": "18.11.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", + "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==" + }, "node_modules/@types/normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", @@ -920,6 +934,11 @@ "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" }, + "node_modules/abstract-logging": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/abstract-logging/-/abstract-logging-2.0.1.tgz", + "integrity": "sha512-2BjRTZxTPvheOvGbBslFSYOUkr+SjPtOnrLP33f+VIWLzezQpZcqVg7ja3L4dBXmzzgwT+a029jRx5PCi3JuiA==" + }, "node_modules/accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", @@ -1165,6 +1184,14 @@ "node": ">=0.10.0" } }, + "node_modules/asn1": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", + "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", + "dependencies": { + "safer-buffer": "~2.1.0" + } + }, "node_modules/assert-options": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/assert-options/-/assert-options-0.7.0.tgz", @@ -1173,6 +1200,14 @@ "node": ">=8.0.0" } }, + "node_modules/assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "engines": { + "node": ">=0.8" + } + }, "node_modules/assign-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", @@ -1208,6 +1243,17 @@ "@babel/core": "^7.0.0" } }, + "node_modules/backoff": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/backoff/-/backoff-2.5.0.tgz", + "integrity": "sha512-wC5ihrnUXmR2douXmXLCe5O3zg3GKIyvRi/hi58a/XyRxVI+3/yM0PYueQOZXPXQ9pxBislYkw+sF9b7C/RuMA==", + "dependencies": { + "precond": "0.2" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/bail": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/bail/-/bail-1.0.5.tgz", @@ -4084,6 +4130,14 @@ "node": ">=0.10.0" } }, + "node_modules/extsprintf": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.1.tgz", + "integrity": "sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA==", + "engines": [ + "node >=0.6.0" + ] + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -6143,6 +6197,44 @@ "node": ">=0.10.0" } }, + "node_modules/ldap-async": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/ldap-async/-/ldap-async-1.3.3.tgz", + "integrity": "sha512-W5Q+6tKsgCv4CmkdFvirKL4R9oiCC9+yEGAAxVAUBwUiDhks23JAa7W0bzfDKuaF8ZbWmMzc+v5pceFtYOxRFA==", + "dependencies": { + "@types/ldapjs": "^2.2.0", + "ldapjs": "^2.3.1" + } + }, + "node_modules/ldap-filter": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/ldap-filter/-/ldap-filter-0.3.3.tgz", + "integrity": "sha512-/tFkx5WIn4HuO+6w9lsfxq4FN3O+fDZeO9Mek8dCD8rTUpqzRa766BOBO7BcGkn3X86m5+cBm1/2S/Shzz7gMg==", + "dependencies": { + "assert-plus": "^1.0.0" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/ldapjs": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/ldapjs/-/ldapjs-2.3.3.tgz", + "integrity": "sha512-75QiiLJV/PQqtpH+HGls44dXweviFwQ6SiIK27EqzKQ5jU/7UFrl2E5nLdQ3IYRBzJ/AVFJI66u0MZ0uofKYwg==", + "dependencies": { + "abstract-logging": "^2.0.0", + "asn1": "^0.2.4", + "assert-plus": "^1.0.0", + "backoff": "^2.5.0", + "ldap-filter": "^0.3.3", + "once": "^1.4.0", + "vasync": "^2.2.0", + "verror": "^1.8.1" + }, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/lead": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz", @@ -8683,6 +8775,14 @@ "node": ">=0.10.0" } }, + "node_modules/precond": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/precond/-/precond-0.2.3.tgz", + "integrity": "sha512-QCYG84SgGyGzqJ/vlMsxeXd/pgL/I94ixdNFyh1PusWmTCyVfPJjZ1K1jvHtsbfnXQs2TSkEP2fR7QiMZAnKFQ==", + "engines": { + "node": ">= 0.6" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -10920,6 +11020,43 @@ "node": ">= 0.8" } }, + "node_modules/vasync": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/vasync/-/vasync-2.2.1.tgz", + "integrity": "sha512-Hq72JaTpcTFdWiNA4Y22Amej2GH3BFmBaKPPlDZ4/oC8HNn2ISHLkFrJU4Ds8R3jcUi7oo5Y9jcMHKjES+N9wQ==", + "engines": [ + "node >=0.6.0" + ], + "dependencies": { + "verror": "1.10.0" + } + }, + "node_modules/vasync/node_modules/verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", + "engines": [ + "node >=0.6.0" + ], + "dependencies": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "node_modules/verror": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.1.tgz", + "integrity": "sha512-veufcmxri4e3XSrT0xwfUR7kguIkaxBeosDg00yDWhk49wdwkSUrvvsm7nc75e1PUyvIeZj6nS8VQRYz2/S4Xg==", + "dependencies": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + }, + "engines": { + "node": ">=0.6.0" + } + }, "node_modules/vfile": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/vfile/-/vfile-4.2.1.tgz", @@ -12102,6 +12239,14 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, + "@types/ldapjs": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@types/ldapjs/-/ldapjs-2.2.5.tgz", + "integrity": "sha512-Lv/nD6QDCmcT+V1vaTRnEKE8UgOilVv5pHcQuzkU1LcRe4mbHHuUo/KHi0LKrpdHhQY8FJzryF38fcVdeUIrzg==", + "requires": { + "@types/node": "*" + } + }, "@types/linkify-it": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.2.tgz", @@ -12134,6 +12279,11 @@ "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.1.tgz", "integrity": "sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==" }, + "@types/node": { + "version": "18.11.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", + "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==" + }, "@types/normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", @@ -12268,6 +12418,11 @@ "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" }, + "abstract-logging": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/abstract-logging/-/abstract-logging-2.0.1.tgz", + "integrity": "sha512-2BjRTZxTPvheOvGbBslFSYOUkr+SjPtOnrLP33f+VIWLzezQpZcqVg7ja3L4dBXmzzgwT+a029jRx5PCi3JuiA==" + }, "accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", @@ -12444,11 +12599,24 @@ "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" }, + "asn1": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", + "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", + "requires": { + "safer-buffer": "~2.1.0" + } + }, "assert-options": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/assert-options/-/assert-options-0.7.0.tgz", "integrity": "sha512-7q9uNH/Dh8gFgpIIb9ja8PJEWA5AQy3xnBC8jtKs8K/gNVCr1K6kIvlm59HUyYgvM7oEDoLzGgPcGd9FqhtXEQ==" }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==" + }, "assign-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", @@ -12470,6 +12638,14 @@ "integrity": "sha512-X40FaxyH7t3X+JFAKvb1H9wooWKLRCi8pg3m8poqtdZaIng+bjzp9RvKQCvRjF9isHiPkXspbbXT/zwXLtwgwg==", "requires": {} }, + "backoff": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/backoff/-/backoff-2.5.0.tgz", + "integrity": "sha512-wC5ihrnUXmR2douXmXLCe5O3zg3GKIyvRi/hi58a/XyRxVI+3/yM0PYueQOZXPXQ9pxBislYkw+sF9b7C/RuMA==", + "requires": { + "precond": "0.2" + } + }, "bail": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/bail/-/bail-1.0.5.tgz", @@ -14653,6 +14829,11 @@ } } }, + "extsprintf": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.1.tgz", + "integrity": "sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA==" + }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -16180,6 +16361,38 @@ "invert-kv": "^1.0.0" } }, + "ldap-async": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/ldap-async/-/ldap-async-1.3.3.tgz", + "integrity": "sha512-W5Q+6tKsgCv4CmkdFvirKL4R9oiCC9+yEGAAxVAUBwUiDhks23JAa7W0bzfDKuaF8ZbWmMzc+v5pceFtYOxRFA==", + "requires": { + "@types/ldapjs": "^2.2.0", + "ldapjs": "^2.3.1" + } + }, + "ldap-filter": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/ldap-filter/-/ldap-filter-0.3.3.tgz", + "integrity": "sha512-/tFkx5WIn4HuO+6w9lsfxq4FN3O+fDZeO9Mek8dCD8rTUpqzRa766BOBO7BcGkn3X86m5+cBm1/2S/Shzz7gMg==", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "ldapjs": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/ldapjs/-/ldapjs-2.3.3.tgz", + "integrity": "sha512-75QiiLJV/PQqtpH+HGls44dXweviFwQ6SiIK27EqzKQ5jU/7UFrl2E5nLdQ3IYRBzJ/AVFJI66u0MZ0uofKYwg==", + "requires": { + "abstract-logging": "^2.0.0", + "asn1": "^0.2.4", + "assert-plus": "^1.0.0", + "backoff": "^2.5.0", + "ldap-filter": "^0.3.3", + "once": "^1.4.0", + "vasync": "^2.2.0", + "verror": "^1.8.1" + } + }, "lead": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz", @@ -18116,6 +18329,11 @@ "xtend": "^4.0.0" } }, + "precond": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/precond/-/precond-0.2.3.tgz", + "integrity": "sha512-QCYG84SgGyGzqJ/vlMsxeXd/pgL/I94ixdNFyh1PusWmTCyVfPJjZ1K1jvHtsbfnXQs2TSkEP2fR7QiMZAnKFQ==" + }, "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -19824,6 +20042,36 @@ "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" }, + "vasync": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/vasync/-/vasync-2.2.1.tgz", + "integrity": "sha512-Hq72JaTpcTFdWiNA4Y22Amej2GH3BFmBaKPPlDZ4/oC8HNn2ISHLkFrJU4Ds8R3jcUi7oo5Y9jcMHKjES+N9wQ==", + "requires": { + "verror": "1.10.0" + }, + "dependencies": { + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + } + } + }, + "verror": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.1.tgz", + "integrity": "sha512-veufcmxri4e3XSrT0xwfUR7kguIkaxBeosDg00yDWhk49wdwkSUrvvsm7nc75e1PUyvIeZj6nS8VQRYz2/S4Xg==", + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, "vfile": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/vfile/-/vfile-4.2.1.tgz", diff --git a/server/package.json b/server/package.json index 2879bb1..7f79578 100644 --- a/server/package.json +++ b/server/package.json @@ -40,7 +40,8 @@ "swagger-ui-express": "^4.4.0", "winston": "^3.8.1", "winston-daily-rotate-file": "^4.7.1", - "xss-clean": "^0.1.1" + "xss-clean": "^0.1.1", + "ldap-async":"^1.3.3" }, "devDependencies": { "standard": "^17.0.0" From 96a5906e065b76e9fea033df7e42c652d2fc635e Mon Sep 17 00:00:00 2001 From: HumbertoDiego Date: Tue, 15 Nov 2022 22:16:43 -0400 Subject: [PATCH 2/7] going ldap --- .../src/layouts/dashboard/DashboardSidebar.js | 27 ++++- client/src/pages/LDAPManagePage.js | 17 +++ client/src/routes.js | 2 + client/src/sections/@user/LDAPInfoCard.js | 108 ++++++++++++++++++ client/src/sections/@user/index.js | 3 +- server/package.json | 5 +- server/src/usuarios/ldap_ctrl.js | 54 +++++++++ 7 files changed, 211 insertions(+), 5 deletions(-) create mode 100644 client/src/pages/LDAPManagePage.js create mode 100644 client/src/sections/@user/LDAPInfoCard.js create mode 100644 server/src/usuarios/ldap_ctrl.js diff --git a/client/src/layouts/dashboard/DashboardSidebar.js b/client/src/layouts/dashboard/DashboardSidebar.js index fa4615a..7b7c447 100644 --- a/client/src/layouts/dashboard/DashboardSidebar.js +++ b/client/src/layouts/dashboard/DashboardSidebar.js @@ -19,6 +19,7 @@ import GroupIcon from '@mui/icons-material/Group' import InsertChartIcon from '@mui/icons-material/InsertChart' import VerifiedUserIcon from '@mui/icons-material/VerifiedUser' import DesktopMacIcon from '@mui/icons-material/DesktopMac' +import CloudSyncIcon from '@mui/icons-material/CloudSync' import { useAPI } from '../../contexts/apiContext' import { styled, useTheme } from '@mui/material/styles'; @@ -88,7 +89,8 @@ export default function MarketplaceSidebar({ isOpenSidebar, onCloseSidebar }) { 'manageUsers': '/gerenciar_usuarios', 'dashboard': '/dashboard', 'authUser': '/autorizar_usuarios', - 'manageApplications': '/gerenciar_aplicacoes' + 'manageApplications': '/gerenciar_aplicacoes', + 'manageLDAP': '/sincronizar_usuarios_ldap' } useEffect(() => { @@ -195,6 +197,29 @@ export default function MarketplaceSidebar({ isOpenSidebar, onCloseSidebar }) { + + + + + + + + ) } diff --git a/client/src/pages/LDAPManagePage.js b/client/src/pages/LDAPManagePage.js new file mode 100644 index 0000000..7ba21c4 --- /dev/null +++ b/client/src/pages/LDAPManagePage.js @@ -0,0 +1,17 @@ +import React from 'react' +import { + Container, +} from '@mui/material'; +import Page from '../components/Page'; +import { LDAPInfoCard } from '../sections/@user'; + +export default function LDAPManagePage() { + + return ( + + + + + + ); +} \ No newline at end of file diff --git a/client/src/routes.js b/client/src/routes.js index e84a50e..053c342 100755 --- a/client/src/routes.js +++ b/client/src/routes.js @@ -14,6 +14,7 @@ const UsersAuthPage = lazy(() => import('./pages/UsersAuthPage')) const ApplicationsManagePage = lazy(() => import('./pages/ApplicationsManagePage')) const DashboardPage = lazy(() => import('./pages/DashboardPage')) const SignUpPage = lazy(() => import('./pages/SignUpPage')) +const LDAPManagePage = lazy(() => import('./pages/LDAPManagePage')) export default function Router() { return useRoutes([ @@ -27,6 +28,7 @@ export default function Router() { { path: '/autorizar_usuarios', element: }, { path: '/gerenciar_aplicacoes', element: }, { path: '/dashboard', element: }, + { path: '/sincronizar_usuarios_ldap', element: }, ] }, { diff --git a/client/src/sections/@user/LDAPInfoCard.js b/client/src/sections/@user/LDAPInfoCard.js new file mode 100644 index 0000000..8fb4b94 --- /dev/null +++ b/client/src/sections/@user/LDAPInfoCard.js @@ -0,0 +1,108 @@ +import React, { useState, useEffect } from 'react' +import { + Typography, + CardContent, + Card, + InputLabel, + Select, + MenuItem, + FormControl, + FormHelperText, + Stack, + TextField, + Button +} from '@mui/material'; +import { useFormik } from 'formik' +import * as yup from 'yup' +import { useAPI } from '../../contexts/apiContext' +import { useSnackbar } from 'notistack'; + +const validationSchema = yup.object({ + basedn: yup + .string('Informe o Distinguished Name (Base DN)') + .required('Campo obrigatório'), + ldapurl: yup + .string('Informe o Host do seriço LDAP') + .required('Campo obrigatório'), +}); + +export default function LDAPInfoCard() { + + const { + updateUserInfo + } = useAPI() + + const { enqueueSnackbar } = useSnackbar(); + + const showSnackbar = (message, variant) => { + // variant could be success, error, warning, info, or default + enqueueSnackbar(message, { variant }); + }; + + const onSubmit = async (values) => { + console.log('Usuário atualizado com sucesso!', 'success') + } + + const formik = useFormik({ + initialValues: { + basedn: 'dc=eb,dc=mil,dc=br', + ldapurl: 'ldap://localhost:389', + }, + validationSchema: validationSchema, + onSubmit: onSubmit, + }); + + return ( + + + + Atualizar dados do usuário + +
+ + + + + +
+
+
+ ); +} \ No newline at end of file diff --git a/client/src/sections/@user/index.js b/client/src/sections/@user/index.js index 30667dd..e5a48e3 100644 --- a/client/src/sections/@user/index.js +++ b/client/src/sections/@user/index.js @@ -2,4 +2,5 @@ export { default as UsersManageTable } from './UsersManageTable'; export { default as UserInfoCard } from './UserInfoCard'; export { default as UsersAuthTable } from './UsersAuthTable'; export { default as ApplicationsManageTable } from './ApplicationsManageTable'; -export { default as UserPasswordCard } from './UserPasswordCard'; \ No newline at end of file +export { default as UserPasswordCard } from './UserPasswordCard'; +export { default as LDAPInfoCard } from './LDAPInfoCard'; \ No newline at end of file diff --git a/server/package.json b/server/package.json index 7f79578..5961649 100644 --- a/server/package.json +++ b/server/package.json @@ -40,9 +40,8 @@ "swagger-ui-express": "^4.4.0", "winston": "^3.8.1", "winston-daily-rotate-file": "^4.7.1", - "xss-clean": "^0.1.1", - "ldap-async":"^1.3.3" - }, + "xss-clean": "^0.1.1" + }, "devDependencies": { "standard": "^17.0.0" }, diff --git a/server/src/usuarios/ldap_ctrl.js b/server/src/usuarios/ldap_ctrl.js new file mode 100644 index 0000000..837f10a --- /dev/null +++ b/server/src/usuarios/ldap_ctrl.js @@ -0,0 +1,54 @@ +'use strict' + +const { db } = require('../database') + +const { AppError, httpCode } = require('../utils') + +const { loginController } = require('../login') + +const bcrypt = require('bcryptjs') + +const users = {} + +const ldap = require('ldapjs'); + +var ldapurl = 'ldap://127.0.0.1:389'; +var basedn = ''; +const opts = { + filter: '(objectClass=*)', + scope: 'sub', + attributes: ['dn', 'sn', 'cn'] + }; + +const client = ldap.createClient({ + url: [ldapurl] +}); + +client.on('error', (err) => { + console.log(err) +}) + +client.search(basedn, opts, (err, res) => { + if(err){ + console.log(err) + } + else{ + res.on('searchRequest', (searchRequest) => { + console.log('searchRequest: ', searchRequest.messageID); + }); + res.on('searchEntry', (entry) => { + console.log('entry: ' + JSON.stringify(entry.object)); + }); + res.on('searchReference', (referral) => { + console.log('referral: ' + referral.uris.join()); + }); + res.on('error', (err) => { + console.error('error: ' + err.message); + }); + res.on('end', (result) => { + console.log('status: ' + result.status); + }); + } + }); + +console.log("Node is working"); \ No newline at end of file From d38a9e9259164766a1bd38e355ced92de91a2b48 Mon Sep 17 00:00:00 2001 From: HumbertoDiego Date: Fri, 18 Nov 2022 21:15:56 -0400 Subject: [PATCH 3/7] backend ok --- client/src/contexts/apiContext.js | 22 ++++- client/src/sections/@user/LDAPInfoCard.js | 13 ++- server/src/usuarios/ldap_ctrl.js | 104 +++++++++++----------- server/src/usuarios/usuario_route.js | 11 +++ 4 files changed, 94 insertions(+), 56 deletions(-) diff --git a/client/src/contexts/apiContext.js b/client/src/contexts/apiContext.js index c6662ae..b077fd3 100644 --- a/client/src/contexts/apiContext.js +++ b/client/src/contexts/apiContext.js @@ -385,6 +385,25 @@ export default function APIProvider({ children }) { } } + const getLDAPUsers = async ( + basedn, + ldapurl, + ) => { + const response = await callAxios( + `/api/usuarios/getldapusers`, + "GET", + { + basedn: basedn, + ldapurl: ldapurl, + } + ); + if (response.error) { + handleError(response.error) + return + } + return response.data + } + return ( {children} diff --git a/client/src/sections/@user/LDAPInfoCard.js b/client/src/sections/@user/LDAPInfoCard.js index 8fb4b94..fa83e6e 100644 --- a/client/src/sections/@user/LDAPInfoCard.js +++ b/client/src/sections/@user/LDAPInfoCard.js @@ -19,17 +19,17 @@ import { useSnackbar } from 'notistack'; const validationSchema = yup.object({ basedn: yup - .string('Informe o Distinguished Name (Base DN)') + .string('Informe o Base Distinguished Name (Base DN)') .required('Campo obrigatório'), ldapurl: yup - .string('Informe o Host do seriço LDAP') + .string('Informe a URL do seriço LDAP') .required('Campo obrigatório'), }); export default function LDAPInfoCard() { const { - updateUserInfo + getLDAPUsers } = useAPI() const { enqueueSnackbar } = useSnackbar(); @@ -40,7 +40,12 @@ export default function LDAPInfoCard() { }; const onSubmit = async (values) => { - console.log('Usuário atualizado com sucesso!', 'success') + const data = await getLDAPUsers( + values.basedn, + values.ldapurl + ) + // TODO colocar numa tabela + showSnackbar('Usuário encontrados com sucesso!', 'success') } const formik = useFormik({ diff --git a/server/src/usuarios/ldap_ctrl.js b/server/src/usuarios/ldap_ctrl.js index 837f10a..d40cbaa 100644 --- a/server/src/usuarios/ldap_ctrl.js +++ b/server/src/usuarios/ldap_ctrl.js @@ -1,54 +1,56 @@ 'use strict' -const { db } = require('../database') - -const { AppError, httpCode } = require('../utils') - -const { loginController } = require('../login') - -const bcrypt = require('bcryptjs') - -const users = {} - const ldap = require('ldapjs'); - -var ldapurl = 'ldap://127.0.0.1:389'; -var basedn = ''; -const opts = { - filter: '(objectClass=*)', - scope: 'sub', - attributes: ['dn', 'sn', 'cn'] - }; - -const client = ldap.createClient({ - url: [ldapurl] -}); - -client.on('error', (err) => { - console.log(err) -}) - -client.search(basedn, opts, (err, res) => { - if(err){ - console.log(err) - } - else{ - res.on('searchRequest', (searchRequest) => { - console.log('searchRequest: ', searchRequest.messageID); - }); - res.on('searchEntry', (entry) => { - console.log('entry: ' + JSON.stringify(entry.object)); - }); - res.on('searchReference', (referral) => { - console.log('referral: ' + referral.uris.join()); - }); - res.on('error', (err) => { - console.error('error: ' + err.message); - }); - res.on('end', (result) => { - console.log('status: ' + result.status); - }); - } - }); - -console.log("Node is working"); \ No newline at end of file +var promise = require('bluebird'); + +//var ldapurl = 'ldap://127.0.0.1:389'; +//var basedn = 'dc=eb,dc=mil,dc=br'; +const controller = {} + +controller.getLDAPusers = (ldapurl,basedn) => { + return new Promise(function(resolve, reject) { + const opts = { + filter: '(objectClass=inetOrgPerson)', + scope: 'sub', + attributes: ['dn', 'sn', 'cn'] + }; + + const client = ldap.createClient({ + url: [ldapurl] + }); + + var users = []; + + client.on('error', (err) => { + console.log(err); + return err + }) + client.search(basedn, opts, (err, res) => { + + if(err){ + console.log(err); + return err + } + else{ + res.on('searchEntry', (entry) => { + //console.log('entry: ' + JSON.stringify(entry.object)); + users.push(entry.object); + }); + res.on('error', (err) => { + console.error('error: ' + err.message); + }); + res.on('end', (result) => { + console.log('status: ' + result.status); + resolve(users) + }); + } + }); + }); +} + +/*controller.getLDAPusers('ldap://127.0.0.1:389','dc=eb,dc=mil,dc=br').then(function (users) { + const msg = 'Usuários retornados com sucesso' + console.log(msg,users) + }); +*/ +module.exports = controller \ No newline at end of file diff --git a/server/src/usuarios/usuario_route.js b/server/src/usuarios/usuario_route.js index ddae0d8..3ec1bcd 100644 --- a/server/src/usuarios/usuario_route.js +++ b/server/src/usuarios/usuario_route.js @@ -8,6 +8,7 @@ const { verifyLogin, verifyAdmin } = require('../login') const usuarioCtrl = require('./usuario_ctrl') const usuarioSchema = require('./usuario_schema') +const LDAPusersCtrl = require('./ldap_ctrl') const router = express.Router() @@ -77,6 +78,16 @@ router.get( }) ) +router.get( + '/getldapusers', + asyncHandler(async (req, res, next) => { + LDAPusersCtrl.getLDAPusers('ldap://127.0.0.1:389','dc=eb,dc=mil,dc=br').then(function (dados) { + const msg = 'Usuários retornados com sucesso' + return res.sendJsonAndLog(true, msg, httpCode.OK, dados) + }); + }) +) + router.post( '/completo', verifyAdmin, From 45f6666c73c0fe0e8fc7e7942cb92d0dce1ebfd1 Mon Sep 17 00:00:00 2001 From: HumbertoDiego Date: Fri, 18 Nov 2022 22:32:01 -0400 Subject: [PATCH 4/7] =?UTF-8?q?Trazer=20usu=C3=A1rios=20SPED?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/contexts/apiContext.js | 2 +- client/src/sections/@user/LDAPInfoCard.js | 10 +++++++--- server/src/usuarios/ldap_ctrl.js | 4 +--- server/src/usuarios/usuario_route.js | 11 +++++++---- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/client/src/contexts/apiContext.js b/client/src/contexts/apiContext.js index b077fd3..e22be33 100644 --- a/client/src/contexts/apiContext.js +++ b/client/src/contexts/apiContext.js @@ -391,7 +391,7 @@ export default function APIProvider({ children }) { ) => { const response = await callAxios( `/api/usuarios/getldapusers`, - "GET", + "POST", { basedn: basedn, ldapurl: ldapurl, diff --git a/client/src/sections/@user/LDAPInfoCard.js b/client/src/sections/@user/LDAPInfoCard.js index fa83e6e..a79c586 100644 --- a/client/src/sections/@user/LDAPInfoCard.js +++ b/client/src/sections/@user/LDAPInfoCard.js @@ -43,9 +43,13 @@ export default function LDAPInfoCard() { const data = await getLDAPUsers( values.basedn, values.ldapurl - ) - // TODO colocar numa tabela - showSnackbar('Usuário encontrados com sucesso!', 'success') + ); + const users = data.dados.map(({cn,sn,givenName}) => { + cn = "ldap:"+cn; + return {cn,sn,givenName} + }); + console.log(users); + showSnackbar(users.length+' usuários encontrados com sucesso!', 'success') } const formik = useFormik({ diff --git a/server/src/usuarios/ldap_ctrl.js b/server/src/usuarios/ldap_ctrl.js index d40cbaa..aeea584 100644 --- a/server/src/usuarios/ldap_ctrl.js +++ b/server/src/usuarios/ldap_ctrl.js @@ -12,7 +12,7 @@ controller.getLDAPusers = (ldapurl,basedn) => { const opts = { filter: '(objectClass=inetOrgPerson)', scope: 'sub', - attributes: ['dn', 'sn', 'cn'] + attributes: ['givenName', 'sn', 'cn'] }; const client = ldap.createClient({ @@ -33,14 +33,12 @@ controller.getLDAPusers = (ldapurl,basedn) => { } else{ res.on('searchEntry', (entry) => { - //console.log('entry: ' + JSON.stringify(entry.object)); users.push(entry.object); }); res.on('error', (err) => { console.error('error: ' + err.message); }); res.on('end', (result) => { - console.log('status: ' + result.status); resolve(users) }); } diff --git a/server/src/usuarios/usuario_route.js b/server/src/usuarios/usuario_route.js index 3ec1bcd..6b72ed9 100644 --- a/server/src/usuarios/usuario_route.js +++ b/server/src/usuarios/usuario_route.js @@ -78,12 +78,15 @@ router.get( }) ) -router.get( +router.post( '/getldapusers', asyncHandler(async (req, res, next) => { - LDAPusersCtrl.getLDAPusers('ldap://127.0.0.1:389','dc=eb,dc=mil,dc=br').then(function (dados) { - const msg = 'Usuários retornados com sucesso' - return res.sendJsonAndLog(true, msg, httpCode.OK, dados) + LDAPusersCtrl.getLDAPusers( + req.body.ldapurl, + req.body.basedn) + .then(function (dados) { + const msg = 'Usuários retornados com sucesso'; + return res.sendJsonAndLog(true, msg, httpCode.OK, dados) }); }) ) From d1f160f3dafe96724cbb49db12d8487c2240feca Mon Sep 17 00:00:00 2001 From: HumbertoDiego Date: Sun, 20 Nov 2022 16:40:59 -0400 Subject: [PATCH 5/7] butttons --- client/src/contexts/apiContext.js | 36 ++++- client/src/sections/@user/LDAPInfoCard.js | 152 +++++++++++++++++++--- server/ldap.env | 2 + server/src/usuarios/ldap_ctrl.js | 39 ++++-- server/src/usuarios/usuario_route.js | 24 ++++ 5 files changed, 228 insertions(+), 25 deletions(-) create mode 100644 server/ldap.env diff --git a/client/src/contexts/apiContext.js b/client/src/contexts/apiContext.js index e22be33..d9c9144 100644 --- a/client/src/contexts/apiContext.js +++ b/client/src/contexts/apiContext.js @@ -404,6 +404,38 @@ export default function APIProvider({ children }) { return response.data } + const saveLDAPenv = async ( + basedn, + ldapurl, + ) => { + const response = await callAxios( + `/api/usuarios/saveldapenv`, + "POST", + { + basedn: basedn, + ldapurl: ldapurl, + } + ); + if (response.error) { + handleError(response.error) + return + } + return response.data + } + + const getLDAPenv = async () => { + const response = await callAxios( + `/api/usuarios/getldapenv`, + "GET", + {} + ); + if (response.error) { + handleError(response.error) + return + } + return response.data + } + return ( {children} diff --git a/client/src/sections/@user/LDAPInfoCard.js b/client/src/sections/@user/LDAPInfoCard.js index a79c586..33e73fd 100644 --- a/client/src/sections/@user/LDAPInfoCard.js +++ b/client/src/sections/@user/LDAPInfoCard.js @@ -3,15 +3,15 @@ import { Typography, CardContent, Card, - InputLabel, - Select, - MenuItem, - FormControl, - FormHelperText, Stack, TextField, - Button + Button, + Box } from '@mui/material'; +import LinearProgress, { LinearProgressProps } from '@mui/material/LinearProgress'; +import SaveIcon from '@mui/icons-material/Save'; +import PersonSearchIcon from '@mui/icons-material/PersonSearch'; +import LoadingButton from '@mui/lab/LoadingButton'; import { useFormik } from 'formik' import * as yup from 'yup' import { useAPI } from '../../contexts/apiContext' @@ -26,10 +26,19 @@ const validationSchema = yup.object({ .required('Campo obrigatório'), }); + export default function LDAPInfoCard() { + const [progress, setprogress] = useState(0); + + const [saveloading, setsaveLoading] = useState(false); + + const [searchusersloading, setsearchusersLoading] = useState(false); + const { - getLDAPUsers + getLDAPUsers, + saveLDAPenv, + getLDAPenv } = useAPI() const { enqueueSnackbar } = useSnackbar(); @@ -40,16 +49,27 @@ export default function LDAPInfoCard() { }; const onSubmit = async (values) => { + setsearchusersLoading(true); + // TODO:loading icon not loading... const data = await getLDAPUsers( values.basedn, values.ldapurl ); - const users = data.dados.map(({cn,sn,givenName}) => { - cn = "ldap:"+cn; - return {cn,sn,givenName} - }); - console.log(users); - showSnackbar(users.length+' usuários encontrados com sucesso!', 'success') + if ('errno' in data.dados){ + var msg = 'Erro: '; + for (const [key, value] of Object.entries(data.dados)) { + msg += `${value} `; + } + showSnackbar(msg, 'error'); + }else{ + const users = data.dados.map(({cn,sn,givenName}) => { + cn = "ldap:"+cn; + return {cn,sn,givenName} + }); + console.log(users); + showSnackbar(users.length+' usuários encontrados com sucesso!', 'success'); + } + setsearchusersLoading(false); } const formik = useFormik({ @@ -61,6 +81,94 @@ export default function LDAPInfoCard() { onSubmit: onSubmit, }); + function SaveButton(props) { + const { + color, + onClick, + loadingPosition, + startIcon, + variant, + children + } = props; + + return ( + + {children} + + ); + } + + function SearchButton(props) { + + return ( + } + variant="contained" + type="submit"> + Procurar usuários + + ); + } + + useEffect(async () => { + const ldapenv = await getLDAPenv(); + if ('dados' in ldapenv){ + if ('basedn' in ldapenv.dados && 'ldapurl' in ldapenv.dados){ + formik.setFieldValue('basedn',ldapenv.dados.basedn); + formik.setFieldValue('ldapurl',ldapenv.dados.ldapurl); + } + } + console.log(ldapenv.dados); + }, []); + + const handleSaveClick = async () =>{ + setsaveLoading(true); + const data = await saveLDAPenv(formik.values.basedn,formik.values.ldapurl); + showSnackbar(data.dados, 'success'); + setsaveLoading(false); + } + + function LinearProgressWithLabel(props) { + return ( + + + + + + + {`${Math.round(props.value,)}%`} + + + + ); + } + + const SyncLDAPClick = () =>{ + setprogress(progress+1); + console.log(formik.values.basedn); + console.log(formik.values.ldapurl); + } + + function LinearWithValueLabel() { + var sx = { width: '100%' }; + if (progress===0){ + sx = { width: '100%' , visibility:'hidden'}; + } + return ( + + + + ); + } + return ( @@ -74,7 +182,7 @@ export default function LDAPInfoCard() { variant="h4" component="div" > - Atualizar dados do usuário + Configurar serviço LDAP
@@ -106,10 +214,22 @@ export default function LDAPInfoCard() { error={formik.touched.ldapurl && Boolean(formik.errors.ldapurl)} helperText={formik.touched.ldapurl && formik.errors.ldapurl} /> - - + +
diff --git a/server/ldap.env b/server/ldap.env new file mode 100644 index 0000000..c5589b4 --- /dev/null +++ b/server/ldap.env @@ -0,0 +1,2 @@ +basedn=dc=eb,dc=mil,dc=br +ldapurl=ldap://10.79.8.15:389 \ No newline at end of file diff --git a/server/src/usuarios/ldap_ctrl.js b/server/src/usuarios/ldap_ctrl.js index aeea584..8a5825e 100644 --- a/server/src/usuarios/ldap_ctrl.js +++ b/server/src/usuarios/ldap_ctrl.js @@ -2,10 +2,13 @@ const ldap = require('ldapjs'); var promise = require('bluebird'); +const fs = require('fs'); -//var ldapurl = 'ldap://127.0.0.1:389'; -//var basedn = 'dc=eb,dc=mil,dc=br'; const controller = {} +const path = require('path') +const configPath = path.join(__dirname, '..', '..', 'ldap.env') +const dotenv = require('dotenv') + controller.getLDAPusers = (ldapurl,basedn) => { return new Promise(function(resolve, reject) { @@ -23,7 +26,7 @@ controller.getLDAPusers = (ldapurl,basedn) => { client.on('error', (err) => { console.log(err); - return err + resolve(err) }) client.search(basedn, opts, (err, res) => { @@ -46,9 +49,29 @@ controller.getLDAPusers = (ldapurl,basedn) => { }); } -/*controller.getLDAPusers('ldap://127.0.0.1:389','dc=eb,dc=mil,dc=br').then(function (users) { - const msg = 'Usuários retornados com sucesso' - console.log(msg,users) - }); -*/ +controller.setLDAPenv = (basedn,ldapurl) => { + return new Promise(function(resolve, reject) { +var msg=`basedn=${basedn} +ldapurl=${ldapurl}` +console.log(msg); +try{ + fs.writeFileSync(configPath, msg); + resolve('Configurações Salvas com sucesso') +}catch (err){ + console.log(err); +} +}); +} + +controller.getLDAPenv = (basedn,ldapurl) => { + return new Promise(function(resolve, reject) { +try{ + const data = fs.readFileSync(configPath, 'utf-8'); + const config = dotenv.parse(data) + resolve(config) +}catch (err){ + console.log(err); +} +}); +} module.exports = controller \ No newline at end of file diff --git a/server/src/usuarios/usuario_route.js b/server/src/usuarios/usuario_route.js index 6b72ed9..463fa74 100644 --- a/server/src/usuarios/usuario_route.js +++ b/server/src/usuarios/usuario_route.js @@ -91,6 +91,30 @@ router.post( }) ) +router.post( + '/saveldapenv', + asyncHandler(async (req, res, next) => { + LDAPusersCtrl.setLDAPenv( + req.body.basedn, + req.body.ldapurl,) + .then(function (dados) { + const msg = 'Arquivo salvo com sucesso'; + return res.sendJsonAndLog(true, msg, httpCode.OK, dados) + }); + }) +) + +router.get( + '/getldapenv', + asyncHandler(async (req, res, next) => { + LDAPusersCtrl.getLDAPenv() + .then(function (dados) { + const msg = 'Arquivo lido com sucesso'; + return res.sendJsonAndLog(true, msg, httpCode.OK, dados) + }); + }) +) + router.post( '/completo', verifyAdmin, From 58bfc33eaef383b2acef3190a443040136261b5b Mon Sep 17 00:00:00 2001 From: HumbertoDiego Date: Mon, 21 Nov 2022 00:00:42 -0400 Subject: [PATCH 6/7] upsert ok --- client/src/contexts/apiContext.js | 22 +++++++++- client/src/sections/@user/LDAPInfoCard.js | 53 +++++++++++++++-------- server/ldap.env | 2 +- server/src/usuarios/ldap_ctrl.js | 28 ++++++++++-- server/src/usuarios/usuario_route.js | 24 ++++++++-- 5 files changed, 102 insertions(+), 27 deletions(-) diff --git a/client/src/contexts/apiContext.js b/client/src/contexts/apiContext.js index d9c9144..0527655 100644 --- a/client/src/contexts/apiContext.js +++ b/client/src/contexts/apiContext.js @@ -436,6 +436,25 @@ export default function APIProvider({ children }) { return response.data } + const upsertLDAPuser = async (usuario, nome, nomeGuerra) => { + console.log(usuario, nome, nomeGuerra ); + + const response = await callAxios( + `/api/usuarios/upsertldapuser`, + "POST", + { + usuario: usuario, + nome: nome, + nomeGuerra: nomeGuerra, + } + ); + if (response.error) { + handleError(response.error) + return + } + return response.data + } + return ( {children} diff --git a/client/src/sections/@user/LDAPInfoCard.js b/client/src/sections/@user/LDAPInfoCard.js index 33e73fd..838349e 100644 --- a/client/src/sections/@user/LDAPInfoCard.js +++ b/client/src/sections/@user/LDAPInfoCard.js @@ -35,10 +35,15 @@ export default function LDAPInfoCard() { const [searchusersloading, setsearchusersLoading] = useState(false); + const [syncbuttondisabled, setsyncbuttondisabled] = useState(true); + + const [users, setusers] = useState([]); + const { getLDAPUsers, saveLDAPenv, - getLDAPenv + getLDAPenv, + upsertLDAPuser } = useAPI() const { enqueueSnackbar } = useSnackbar(); @@ -50,7 +55,6 @@ export default function LDAPInfoCard() { const onSubmit = async (values) => { setsearchusersLoading(true); - // TODO:loading icon not loading... const data = await getLDAPUsers( values.basedn, values.ldapurl @@ -62,14 +66,12 @@ export default function LDAPInfoCard() { } showSnackbar(msg, 'error'); }else{ - const users = data.dados.map(({cn,sn,givenName}) => { - cn = "ldap:"+cn; - return {cn,sn,givenName} - }); - console.log(users); - showSnackbar(users.length+' usuários encontrados com sucesso!', 'success'); + setusers(data.dados); + console.log(data.dados); + showSnackbar(data.dados.length+' usuários encontrados com sucesso!', 'success'); } setsearchusersLoading(false); + setsyncbuttondisabled(false) } const formik = useFormik({ @@ -105,7 +107,6 @@ export default function LDAPInfoCard() { } function SearchButton(props) { - return ( Procurar usuários - + ); } @@ -127,7 +128,7 @@ export default function LDAPInfoCard() { } } console.log(ldapenv.dados); - }, []); + }, []);// eslint-disable-line react-hooks/exhaustive-deps const handleSaveClick = async () =>{ setsaveLoading(true); @@ -151,12 +152,28 @@ export default function LDAPInfoCard() { ); } - const SyncLDAPClick = () =>{ - setprogress(progress+1); - console.log(formik.values.basedn); - console.log(formik.values.ldapurl); + const SyncLDAPClick = async () =>{ + var r; + for (var i=0; i + Trazer usuários + + ); + } + function LinearWithValueLabel() { var sx = { width: '100%' }; if (progress===0){ @@ -217,7 +234,7 @@ export default function LDAPInfoCard() { button': { m: 1 } }}> } @@ -225,9 +242,7 @@ export default function LDAPInfoCard() { Salvar - + diff --git a/server/ldap.env b/server/ldap.env index c5589b4..2c575ee 100644 --- a/server/ldap.env +++ b/server/ldap.env @@ -1,2 +1,2 @@ basedn=dc=eb,dc=mil,dc=br -ldapurl=ldap://10.79.8.15:389 \ No newline at end of file +ldapurl=ldap://localhost:389 \ No newline at end of file diff --git a/server/src/usuarios/ldap_ctrl.js b/server/src/usuarios/ldap_ctrl.js index 8a5825e..35fe49d 100644 --- a/server/src/usuarios/ldap_ctrl.js +++ b/server/src/usuarios/ldap_ctrl.js @@ -8,14 +8,18 @@ const controller = {} const path = require('path') const configPath = path.join(__dirname, '..', '..', 'ldap.env') const dotenv = require('dotenv') - +const { db } = require('../database') controller.getLDAPusers = (ldapurl,basedn) => { return new Promise(function(resolve, reject) { const opts = { filter: '(objectClass=inetOrgPerson)', scope: 'sub', - attributes: ['givenName', 'sn', 'cn'] + attributes: ['givenName', 'sn', 'cn'], + paged: { + pageSize: 250, + pagePause: false + }, }; const client = ldap.createClient({ @@ -39,7 +43,11 @@ controller.getLDAPusers = (ldapurl,basedn) => { users.push(entry.object); }); res.on('error', (err) => { - console.error('error: ' + err.message); + console.error('error: ' + err.message); + resolve(err.message) + }); + res.on('page', (result) => { + console.log('next ldapsearch page'); }); res.on('end', (result) => { resolve(users) @@ -74,4 +82,18 @@ try{ } }); } + +controller.upsertLDAPuser = (usuario,nome,nomeGuerra) => { + console.log(usuario, nome, nomeGuerra ); + var login = 'ldap:'+usuario; + const hash = '$2a$10$ElIB/ay0mBLx2sqUgI1U6uMWwkrhda.lYhmjryHcRLJKb32d7EFeu'; + const tipoPostoGradId = 8; + const tipoTurnoId = 3; + return db.conn.none( + `INSERT INTO dgeo.usuario(login, senha, nome, nome_guerra, administrador, ativo, tipo_posto_grad_id, tipo_turno_id) + VALUES ($, $, $, $, FALSE, FALSE, $, $)`, + { login, hash, nome, nomeGuerra, tipoPostoGradId, tipoTurnoId } + ) +} + module.exports = controller \ No newline at end of file diff --git a/server/src/usuarios/usuario_route.js b/server/src/usuarios/usuario_route.js index 463fa74..cb16892 100644 --- a/server/src/usuarios/usuario_route.js +++ b/server/src/usuarios/usuario_route.js @@ -85,7 +85,12 @@ router.post( req.body.ldapurl, req.body.basedn) .then(function (dados) { - const msg = 'Usuários retornados com sucesso'; + if (typeof dados === 'string'){ + dados = {'errno': dados}; + var msg = 'Erro'; + }else{ + var msg = 'Usuários retornados com sucesso'; + } return res.sendJsonAndLog(true, msg, httpCode.OK, dados) }); }) @@ -107,8 +112,21 @@ router.post( router.get( '/getldapenv', asyncHandler(async (req, res, next) => { - LDAPusersCtrl.getLDAPenv() - .then(function (dados) { + LDAPusersCtrl.getLDAPenv().then(function (dados) { + const msg = 'Arquivo lido com sucesso'; + return res.sendJsonAndLog(true, msg, httpCode.OK, dados) + }); + }) +) + +router.post( + '/upsertldapuser', + asyncHandler(async (req, res, next) => { + LDAPusersCtrl.upsertLDAPuser( + req.body.usuario, + req.body.nome, + req.body.nomeGuerra + ).then(function (dados) { const msg = 'Arquivo lido com sucesso'; return res.sendJsonAndLog(true, msg, httpCode.OK, dados) }); From 3d6faad6c0ae0033a9dfa0e6244271a634f10db7 Mon Sep 17 00:00:00 2001 From: Humberto Alves Date: Mon, 21 Nov 2022 13:17:26 -0400 Subject: [PATCH 7/7] ldap:username login ok --- README.md | 36 ++++++++++++++++++ client/src/contexts/apiContext.js | 2 - client/src/sections/@user/LDAPInfoCard.js | 18 +++++++-- create_config.js | 2 +- server/ldap.env | 2 +- server/package-lock.json | 46 +---------------------- server/package.json | 3 +- server/src/login/login_ctrl.js | 46 ++++++++++++++++++++++- server/src/usuarios/ldap_ctrl.js | 30 +++++++-------- server/src/usuarios/usuario_route.js | 4 +- 10 files changed, 114 insertions(+), 75 deletions(-) diff --git a/README.md b/README.md index 5a9662b..e586a4a 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,39 @@ Para mais informações acessar a [Wiki](https://github.com/1cgeo/auth_server/wi ## Releases - [v.1.1.0](https://github.com/1cgeo/auth_server/releases/tag/v.1.1.0) - [v.1.0.0](https://github.com/1cgeo/auth_server/releases/tag/v.1.0.0) + +## Requisitos para sincronização com serviço LDAP local (existente no SPED). + +1. Certifique-se que o serviço LDAP do SPED está aberto para a serviço de autenticação: + Executar no computador do serviço LDAP: + ``` + $ nano /etc/default/slapd # Editar: + #SLAPD_SERVICES="ldap://127.0.0.1:389/ ldaps:/// ldapi:///" + SLAPD_SERVICES="ldap:/// ldapi:///" + + $ service slapd restart + ``` + + Executar no computador do serviço de autenticação: + ``` + $ apt install ldap-utils + $ ldapsearch -H ldap:// -x -b dc=eb,dc=mil,dc=br # deve retornar até 500 usuários + ``` + +2. Autorizar a pesquisa de mais de 500 usuários: + Executar no computador do serviço LDAP: + ``` + $ nano sizelimit.ldif # Adicionar o seguinte conteúdo + dn: cn=config + changetype: modify + replace: olcSizeLimit + olcSizeLimit: 7000 + + $ ldapmodify -Q -Y EXTERNAL -H ldapi:// -f sizelimit.ldif + ``` + + Executar no computador do serviço de autenticação: + ``` + $ apt install ldap-utils + $ ldapsearch -H ldap:// -x -b dc=eb,dc=mil,dc=br # deve retornar até 7000 usuários + ``` \ No newline at end of file diff --git a/client/src/contexts/apiContext.js b/client/src/contexts/apiContext.js index 0527655..d2663c2 100644 --- a/client/src/contexts/apiContext.js +++ b/client/src/contexts/apiContext.js @@ -437,8 +437,6 @@ export default function APIProvider({ children }) { } const upsertLDAPuser = async (usuario, nome, nomeGuerra) => { - console.log(usuario, nome, nomeGuerra ); - const response = await callAxios( `/api/usuarios/upsertldapuser`, "POST", diff --git a/client/src/sections/@user/LDAPInfoCard.js b/client/src/sections/@user/LDAPInfoCard.js index 838349e..8701780 100644 --- a/client/src/sections/@user/LDAPInfoCard.js +++ b/client/src/sections/@user/LDAPInfoCard.js @@ -154,12 +154,24 @@ export default function LDAPInfoCard() { const SyncLDAPClick = async () =>{ var r; - for (var i=0; i 100 req (ainda passa!) + const n = 10; + for (var i = 0, j = 0; i < users.length; i++) { + if (i >= n && i % n === 0){j++;} + grouped_users[j] = grouped_users[j] || []; + grouped_users[j].push(users[i]) + } + const grouped_users_reversed = grouped_users.reverse(); + for (var i=0; i { +const handleError = (error) => { if ( error.message === 'Postgres error. Cause: permission denied to create database' diff --git a/server/ldap.env b/server/ldap.env index 2c575ee..97fb9ac 100644 --- a/server/ldap.env +++ b/server/ldap.env @@ -1,2 +1,2 @@ basedn=dc=eb,dc=mil,dc=br -ldapurl=ldap://localhost:389 \ No newline at end of file +ldapurl=ldap://10.79.8.254:389 \ No newline at end of file diff --git a/server/package-lock.json b/server/package-lock.json index bfc4fc7..67a4205 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -23,7 +23,7 @@ "joi": "^17.6.0", "jsdoc": "^3.6.10", "jsonwebtoken": "^8.5.1", - "ldap-async": "^1.3.3", + "ldapjs": "^2.3.3", "minimist": "^1.2.6", "nocache": "^3.0.4", "nodemon": "^2.0.18", @@ -744,14 +744,6 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, - "node_modules/@types/ldapjs": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/@types/ldapjs/-/ldapjs-2.2.5.tgz", - "integrity": "sha512-Lv/nD6QDCmcT+V1vaTRnEKE8UgOilVv5pHcQuzkU1LcRe4mbHHuUo/KHi0LKrpdHhQY8FJzryF38fcVdeUIrzg==", - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/linkify-it": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.2.tgz", @@ -784,11 +776,6 @@ "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.1.tgz", "integrity": "sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==" }, - "node_modules/@types/node": { - "version": "18.11.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", - "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==" - }, "node_modules/@types/normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", @@ -6197,15 +6184,6 @@ "node": ">=0.10.0" } }, - "node_modules/ldap-async": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/ldap-async/-/ldap-async-1.3.3.tgz", - "integrity": "sha512-W5Q+6tKsgCv4CmkdFvirKL4R9oiCC9+yEGAAxVAUBwUiDhks23JAa7W0bzfDKuaF8ZbWmMzc+v5pceFtYOxRFA==", - "dependencies": { - "@types/ldapjs": "^2.2.0", - "ldapjs": "^2.3.1" - } - }, "node_modules/ldap-filter": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/ldap-filter/-/ldap-filter-0.3.3.tgz", @@ -12239,14 +12217,6 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, - "@types/ldapjs": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/@types/ldapjs/-/ldapjs-2.2.5.tgz", - "integrity": "sha512-Lv/nD6QDCmcT+V1vaTRnEKE8UgOilVv5pHcQuzkU1LcRe4mbHHuUo/KHi0LKrpdHhQY8FJzryF38fcVdeUIrzg==", - "requires": { - "@types/node": "*" - } - }, "@types/linkify-it": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.2.tgz", @@ -12279,11 +12249,6 @@ "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.1.tgz", "integrity": "sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==" }, - "@types/node": { - "version": "18.11.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", - "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==" - }, "@types/normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", @@ -16361,15 +16326,6 @@ "invert-kv": "^1.0.0" } }, - "ldap-async": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/ldap-async/-/ldap-async-1.3.3.tgz", - "integrity": "sha512-W5Q+6tKsgCv4CmkdFvirKL4R9oiCC9+yEGAAxVAUBwUiDhks23JAa7W0bzfDKuaF8ZbWmMzc+v5pceFtYOxRFA==", - "requires": { - "@types/ldapjs": "^2.2.0", - "ldapjs": "^2.3.1" - } - }, "ldap-filter": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/ldap-filter/-/ldap-filter-0.3.3.tgz", diff --git a/server/package.json b/server/package.json index 5961649..52c5255 100644 --- a/server/package.json +++ b/server/package.json @@ -29,6 +29,7 @@ "joi": "^17.6.0", "jsdoc": "^3.6.10", "jsonwebtoken": "^8.5.1", + "ldapjs": "^2.3.3", "minimist": "^1.2.6", "nocache": "^3.0.4", "nodemon": "^2.0.18", @@ -41,7 +42,7 @@ "winston": "^3.8.1", "winston-daily-rotate-file": "^4.7.1", "xss-clean": "^0.1.1" - }, + }, "devDependencies": { "standard": "^17.0.0" }, diff --git a/server/src/login/login_ctrl.js b/server/src/login/login_ctrl.js index 2752805..939bd5a 100644 --- a/server/src/login/login_ctrl.js +++ b/server/src/login/login_ctrl.js @@ -10,6 +10,16 @@ const { AppError, httpCode } = require("../utils"); const { JWT_SECRET } = require("../config"); +const path = require('path'); +const configPath = path.join(__dirname, '..', '..', 'ldap.env'); +const ldap = require('ldapjs'); +const dotenv = require('dotenv'); +const fs = require('fs'); +const data = fs.readFileSync(configPath, 'utf-8'); +const config = dotenv.parse(data); +const basedn = config.basedn; +const ldapurl = config.ldapurl; + const controller = {}; const gravaLogin = async (usuarioId, aplicacaoId, connection) => { @@ -43,6 +53,34 @@ const comparePassword = async (senhaFornecida, senhaDb) => { return bcrypt.compare(senhaFornecida, senhaDb); }; +const compareLDAPPassword = async (senha, usuario) => { + return new Promise(function(resolve, reject) { + const opts = { + filter: '(objectClass=inetOrgPerson)', + scope: 'sub', + attributes: ['givenName', 'sn', 'cn'], + }; + + const client = ldap.createClient({ + url: [ldapurl] + }); + + client.on('error', (err) => { + console.log(err); + resolve(false); + }); + client.bind(`cn=${usuario},${basedn}`, senha, (err) => { + if(err){ + console.log(err); + resolve(false); + } + else{ + resolve(true); + } + }); + }); + } + controller.login = async (usuario, senha, aplicacao) => { return db.conn.tx(async (t) => { const aplicacaoId = await t.oneOrNone( @@ -66,8 +104,12 @@ controller.login = async (usuario, senha, aplicacao) => { httpCode.BadRequest ); } - - const correctPassword = await comparePassword(senha, usuarioDb.senha); + var correctPassword = false; + if (usuario.includes("ldap:")){ + correctPassword = await compareLDAPPassword(senha, usuario.replace("ldap:","")); + }else{ + correctPassword = await comparePassword(senha, usuarioDb.senha); + } if (!correctPassword) { throw new AppError("Usuário ou senha inválida", httpCode.BadRequest); } diff --git a/server/src/usuarios/ldap_ctrl.js b/server/src/usuarios/ldap_ctrl.js index 35fe49d..b657c1b 100644 --- a/server/src/usuarios/ldap_ctrl.js +++ b/server/src/usuarios/ldap_ctrl.js @@ -1,18 +1,18 @@ 'use strict' const ldap = require('ldapjs'); -var promise = require('bluebird'); const fs = require('fs'); const controller = {} const path = require('path') const configPath = path.join(__dirname, '..', '..', 'ldap.env') const dotenv = require('dotenv') -const { db } = require('../database') +const { db } = require('../database'); controller.getLDAPusers = (ldapurl,basedn) => { return new Promise(function(resolve, reject) { - const opts = { + + const opts = { filter: '(objectClass=inetOrgPerson)', scope: 'sub', attributes: ['givenName', 'sn', 'cn'], @@ -33,7 +33,6 @@ controller.getLDAPusers = (ldapurl,basedn) => { resolve(err) }) client.search(basedn, opts, (err, res) => { - if(err){ console.log(err); return err @@ -50,7 +49,7 @@ controller.getLDAPusers = (ldapurl,basedn) => { console.log('next ldapsearch page'); }); res.on('end', (result) => { - resolve(users) + resolve(users) }); } }); @@ -83,17 +82,14 @@ try{ }); } -controller.upsertLDAPuser = (usuario,nome,nomeGuerra) => { - console.log(usuario, nome, nomeGuerra ); - var login = 'ldap:'+usuario; - const hash = '$2a$10$ElIB/ay0mBLx2sqUgI1U6uMWwkrhda.lYhmjryHcRLJKb32d7EFeu'; - const tipoPostoGradId = 8; - const tipoTurnoId = 3; - return db.conn.none( - `INSERT INTO dgeo.usuario(login, senha, nome, nome_guerra, administrador, ativo, tipo_posto_grad_id, tipo_turno_id) - VALUES ($, $, $, $, FALSE, FALSE, $, $)`, - { login, hash, nome, nomeGuerra, tipoPostoGradId, tipoTurnoId } - ) -} +controller.upsertLDAPuser = async (grouped_users) => { + return db.conn.tx(t => { + const queries = grouped_users.map(l => { + return t.none(`INSERT INTO dgeo.usuario(login, senha, nome, nome_guerra, administrador, ativo, tipo_posto_grad_id, tipo_turno_id) + VALUES('ldap:${l.cn}','','${l.sn}','${l.givenName}',FALSE,FALSE,6,3) ON CONFLICT DO NOTHING;`, l); + }); + return t.batch(queries); // array of n-nulls + }) +} module.exports = controller \ No newline at end of file diff --git a/server/src/usuarios/usuario_route.js b/server/src/usuarios/usuario_route.js index cb16892..f648565 100644 --- a/server/src/usuarios/usuario_route.js +++ b/server/src/usuarios/usuario_route.js @@ -124,10 +124,8 @@ router.post( asyncHandler(async (req, res, next) => { LDAPusersCtrl.upsertLDAPuser( req.body.usuario, - req.body.nome, - req.body.nomeGuerra ).then(function (dados) { - const msg = 'Arquivo lido com sucesso'; + const msg = req.body.usuario.length+' usuários sincronizados com sucesso'; return res.sendJsonAndLog(true, msg, httpCode.OK, dados) }); })