From 94b26b8ef0ce2bc4c04e79a7fbe5ad34d08b435b Mon Sep 17 00:00:00 2001 From: NfoAlex <40430040+NfoAlex@users.noreply.github.com> Date: Tue, 4 Jul 2023 17:03:09 +0900 Subject: [PATCH 1/9] =?UTF-8?q?[add]=20-=20=E3=83=8F=E3=83=83=E3=82=B7?= =?UTF-8?q?=E3=83=A5=E5=8C=96=E3=81=99=E3=82=8B=E3=81=9F=E3=82=81=E3=81=AE?= =?UTF-8?q?=E3=83=A9=E3=82=A4=E3=83=96=E3=83=A9=E3=83=AA=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 305 ++++++++++++++++++++++++++++++++++------------ package.json | 1 + 2 files changed, 229 insertions(+), 77 deletions(-) diff --git a/package-lock.json b/package-lock.json index 18e566c..4c33b16 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,6 +5,7 @@ "packages": { "": { "dependencies": { + "bcrypt": "^5.1.0", "express": "^4.18.2", "link-preview-generator": "^1.1.0", "link-preview-js": "^3.0.4", @@ -73,6 +74,25 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, + "node_modules/@mapbox/node-pre-gyp": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz", + "integrity": "sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==", + "dependencies": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + } + }, "node_modules/@npmcli/fs": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-3.1.0.tgz", @@ -292,15 +312,15 @@ "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==" }, "node_modules/are-we-there-yet": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", - "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", "dependencies": { "delegates": "^1.0.0", "readable-stream": "^3.6.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=10" } }, "node_modules/arr-union": { @@ -382,6 +402,19 @@ "node": "^4.5.0 || >= 5.9" } }, + "node_modules/bcrypt": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/bcrypt/-/bcrypt-5.1.0.tgz", + "integrity": "sha512-RHBS7HI5N5tEnGTmtR/pppX0mmDSBpQ4aCBsj7CEQfYXDcO74A8sIBYcJMuCsis2E81zDxeENYhv66oZwLiA+Q==", + "hasInstallScript": true, + "dependencies": { + "@mapbox/node-pre-gyp": "^1.0.10", + "node-addon-api": "^5.0.0" + }, + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", @@ -506,6 +539,17 @@ "balanced-match": "^1.0.0" } }, + "node_modules/cacache/node_modules/fs-minipass": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.2.tgz", + "integrity": "sha512-2GAfyfoaCDRrM6jaOS3UsBts8yJ55VioXdWcOL7dK9zdAuKT71+WBA4ifnNYqVjYv+4SsPxjK0JT4yIIn4cA/g==", + "dependencies": { + "minipass": "^5.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/cacache/node_modules/glob": { "version": "10.3.1", "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.1.tgz", @@ -527,6 +571,14 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/cacache/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "engines": { + "node": ">=12" + } + }, "node_modules/cacache/node_modules/minimatch": { "version": "9.0.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.2.tgz", @@ -596,9 +648,12 @@ } }, "node_modules/chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "engines": { + "node": ">=10" + } }, "node_modules/clean-stack": { "version": "2.2.0", @@ -725,6 +780,25 @@ "node-fetch": "2.6.7" } }, + "node_modules/cross-fetch/node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -821,6 +895,14 @@ "npm": "1.2.8000 || >= 1.4.16" } }, + "node_modules/detect-libc": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", + "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==", + "engines": { + "node": ">=8" + } + }, "node_modules/devtools-protocol": { "version": "0.0.854822", "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.854822.tgz", @@ -1307,14 +1389,25 @@ } }, "node_modules/fs-minipass": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.2.tgz", - "integrity": "sha512-2GAfyfoaCDRrM6jaOS3UsBts8yJ55VioXdWcOL7dK9zdAuKT71+WBA4ifnNYqVjYv+4SsPxjK0JT4yIIn4cA/g==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", "dependencies": { - "minipass": "^5.0.0" + "minipass": "^3.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": ">= 8" + } + }, + "node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, "node_modules/fs.realpath": { @@ -1328,21 +1421,22 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "node_modules/gauge": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", - "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", "dependencies": { "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.3", - "console-control-strings": "^1.1.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", "has-unicode": "^2.0.1", - "signal-exit": "^3.0.7", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", "string-width": "^4.2.3", "strip-ansi": "^6.0.1", - "wide-align": "^1.1.5" + "wide-align": "^1.1.2" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=10" } }, "node_modules/get-intrinsic": { @@ -1885,11 +1979,36 @@ } }, "node_modules/lru-cache": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", - "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, "engines": { - "node": ">=12" + "node": ">=10" + } + }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "bin": { + "semver": "bin/semver.js" } }, "node_modules/make-fetch-happen": { @@ -1917,6 +2036,14 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/make-fetch-happen/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "engines": { + "node": ">=12" + } + }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -2181,10 +2308,15 @@ "node": ">= 0.6" } }, + "node_modules/node-addon-api": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz", + "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==" + }, "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", + "integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==", "dependencies": { "whatwg-url": "^5.0.0" }, @@ -2224,7 +2356,37 @@ "node": "^12.13 || ^14.13 || >=16" } }, - "node_modules/nopt": { + "node_modules/node-gyp/node_modules/are-we-there-yet": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", + "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/node-gyp/node_modules/gauge": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", + "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.3", + "console-control-strings": "^1.1.0", + "has-unicode": "^2.0.1", + "signal-exit": "^3.0.7", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.5" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/node-gyp/node_modules/nopt": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/nopt/-/nopt-6.0.0.tgz", "integrity": "sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==", @@ -2238,6 +2400,34 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/node-gyp/node_modules/npmlog": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", + "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", + "dependencies": { + "are-we-there-yet": "^3.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^4.0.3", + "set-blocking": "^2.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/normalize-url": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-5.3.1.tgz", @@ -2250,17 +2440,14 @@ } }, "node_modules/npmlog": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", - "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", "dependencies": { - "are-we-there-yet": "^3.0.0", + "are-we-there-yet": "^2.0.0", "console-control-strings": "^1.1.0", - "gauge": "^4.0.3", + "gauge": "^3.0.0", "set-blocking": "^2.0.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/nth-check": { @@ -2976,17 +3163,6 @@ "node": ">=10" } }, - "node_modules/semver/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/send": { "version": "0.18.0", "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", @@ -3392,6 +3568,11 @@ "tar-stream": "^2.1.4" } }, + "node_modules/tar-fs/node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" + }, "node_modules/tar-stream": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", @@ -3407,36 +3588,6 @@ "node": ">=6" } }, - "node_modules/tar/node_modules/chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", - "engines": { - "node": ">=10" - } - }, - "node_modules/tar/node_modules/fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/tar/node_modules/fs-minipass/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", diff --git a/package.json b/package.json index e0d5e08..b401315 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "dependencies": { + "bcrypt": "^5.1.0", "express": "^4.18.2", "link-preview-generator": "^1.1.0", "link-preview-js": "^3.0.4", From 9300bdf7820e71060b066005eb546f1863bee9c4 Mon Sep 17 00:00:00 2001 From: NfoAlex <40430040+NfoAlex@users.noreply.github.com> Date: Tue, 4 Jul 2023 17:21:39 +0900 Subject: [PATCH 2/9] =?UTF-8?q?[change]=20-=20=E3=82=A2=E3=82=AB=E3=82=A6?= =?UTF-8?q?=E3=83=B3=E3=83=88=E7=99=BB=E9=8C=B2=E6=99=82=E3=81=AB=E3=83=91?= =?UTF-8?q?=E3=82=B9=E3=83=AF=E3=83=BC=E3=83=89=E3=82=92=E3=83=8F=E3=83=83?= =?UTF-8?q?=E3=82=B7=E3=83=A5=E5=8C=96=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- auth.js | 12 +++++++++--- index.js | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/auth.js b/auth.js index 92dbc1a..8ae9fb3 100644 --- a/auth.js +++ b/auth.js @@ -1,6 +1,7 @@ //auth.js const fs = require('fs'); //履歴書き込むため +const bcrypt = require("bcrypt"); //ハッシュ化用 let db = require("./dbControl.js"); //ユーザー認証 @@ -108,7 +109,7 @@ let authUserBySession = function authUserBySession(cred) { } //ユーザーの新規登録、そしてパスワードを返す -let registerUser = function registerUser(dat) { //dat=[0=>name(名前), 1=>key(招待コード)] +let registerUser = async function registerUser(dat) { //dat=[0=>name(名前), 1=>key(招待コード)] //招待制だったらコードを確認 if ( db.dataServer.registration.invite.inviteOnly && db.dataServer.registration.available ) { //招待制かどうか //招待コードが一致しているかどうか @@ -129,11 +130,16 @@ let registerUser = function registerUser(dat) { //dat=[0=>name(名前), 1=>key( } + //パスワードを生成 + const pwGenerated = generateKey(); + //DBに書くためにハッシュ化する + const pwHashed = await bcrypt.hash(pwGenerated, 10); + //DBに登録 db.dataUser.user[newID] = { "name": dat[0], "role": "Member", - "pw": generateKey(), + "pw": pwHashed, "icon": "", "state": { "loggedin": false, @@ -155,7 +161,7 @@ let registerUser = function registerUser(dat) { //dat=[0=>name(名前), 1=>key( fs.copyFileSync("./img/default.jpeg", "./img/" + newID + ".jpeg"); //パスワードを返す - return db.dataUser.user[newID].pw; + return pwGenerated; } diff --git a/index.js b/index.js index 682d1ca..7f9330d 100644 --- a/index.js +++ b/index.js @@ -1070,9 +1070,9 @@ io.on("connection", (socket) => { }); //新規登録 - socket.on("register", (dat) => { + socket.on("register", async (dat) => { console.log("register :: 登録しようとしてる", dat); - let key = auth.registerUser(dat); //DBにユーザーを登録、パスワードの取得 + let key = await auth.registerUser(dat); //DBにユーザーを登録、パスワードの取得 //返り値が-1じゃないなら if ( key !== -1 ) { From b3704e483f61727285043588f406144687889097 Mon Sep 17 00:00:00 2001 From: NfoAlex <40430040+NfoAlex@users.noreply.github.com> Date: Tue, 4 Jul 2023 17:24:05 +0900 Subject: [PATCH 3/9] Update package-lock.json --- package-lock.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package-lock.json b/package-lock.json index 4c33b16..8ff3864 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,7 @@ "requires": true, "packages": { "": { + "name": "Girack-v-Backend", "dependencies": { "bcrypt": "^5.1.0", "express": "^4.18.2", From f08cc28b29645e47a2e9512b3347c7b200e93b27 Mon Sep 17 00:00:00 2001 From: NfoAlex <40430040+NfoAlex@users.noreply.github.com> Date: Tue, 4 Jul 2023 18:19:47 +0900 Subject: [PATCH 4/9] =?UTF-8?q?[add]=20-=20=E3=83=91=E3=82=B9=E3=83=AF?= =?UTF-8?q?=E3=83=BC=E3=83=89=E8=AA=8D=E8=A8=BC=E3=81=A7=E3=81=AE=E3=83=8F?= =?UTF-8?q?=E3=83=83=E3=82=B7=E3=83=A5=E5=8C=96=E3=83=97=E3=83=AD=E3=83=88?= =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=97=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- auth.js | 20 ++++++++++++++++---- index.js | 4 ++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/auth.js b/auth.js index 8ae9fb3..f9ff9f5 100644 --- a/auth.js +++ b/auth.js @@ -5,12 +5,14 @@ const bcrypt = require("bcrypt"); //ハッシュ化用 let db = require("./dbControl.js"); //ユーザー認証 -let authUser = function authUser(cred) { +let authUser = async function authUser(cred) { console.log("authUser :: これから確認..."); - //データからユーザー名とパスワードを抽出 + //データからユーザー名とパスワード(ハッシュ化)を抽出 let username = cred.username; - let password = cred.password; + let password = await bcrypt.hash(cred.password,10); + + console.log("auth :: authUser : ハッシュ化したpw->", password); //それぞれのユーザーリストの中でパスワードが一致しているやつを探す for (let i=0; i { // 認証関連 //認証 - socket.on("auth", (key, CLIENT_VERSION) => { //key = "パスワード" + socket.on("auth", async (key, CLIENT_VERSION) => { //key = "パスワード" console.log("auth :: 受信 ↓"); console.log(key); @@ -894,7 +894,7 @@ io.on("connection", (socket) => { } - let loginAttempt = auth.authUser(key); //ログイン結果 + let loginAttempt = await auth.authUser(key); //ログイン結果 //認証結果を元にユーザーをオンラインとして記録する if ( loginAttempt.result ) { From 21c6596361b4af3cd20ff636baef77a0ed114819 Mon Sep 17 00:00:00 2001 From: NfoAlex <40430040+NfoAlex@users.noreply.github.com> Date: Tue, 4 Jul 2023 18:20:04 +0900 Subject: [PATCH 5/9] Update package-lock.json --- package-lock.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 8ff3864..4c33b16 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,7 +4,6 @@ "requires": true, "packages": { "": { - "name": "Girack-v-Backend", "dependencies": { "bcrypt": "^5.1.0", "express": "^4.18.2", From fc64893088f69eb7407dfd080493f3d1d6a35fc9 Mon Sep 17 00:00:00 2001 From: NfoAlex <40430040+NfoAlex@users.noreply.github.com> Date: Tue, 4 Jul 2023 18:40:31 +0900 Subject: [PATCH 6/9] =?UTF-8?q?[remove]=20-=20=E4=B8=8D=E8=A6=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/index.js b/index.js index d8d6b43..d67c8b8 100644 --- a/index.js +++ b/index.js @@ -1047,9 +1047,6 @@ io.on("connection", (socket) => { } - //このsocketのIDのユーザーIDを空に - //socketOnline[socket.id] = ""; - //ユーザーIDの接続数が1以下(エラー回避用)ならオンラインユーザーJSONから削除、そうじゃないなら減算するだけ if ( userOnline[dat.reqSender.userid] >= 2 ) { userOnline[dat.reqSender.userid] -= 1; From 6b0a1e0cc72a561938ed00c9a810a1947a0e43a9 Mon Sep 17 00:00:00 2001 From: NfoAlex <40430040+NfoAlex@users.noreply.github.com> Date: Tue, 4 Jul 2023 18:40:58 +0900 Subject: [PATCH 7/9] =?UTF-8?q?[fix]=20-=20=E3=83=8F=E3=83=83=E3=82=B7?= =?UTF-8?q?=E3=83=A5=E6=AF=94=E8=BC=83=E9=96=A2=E6=95=B0=E3=82=92=E4=BD=BF?= =?UTF-8?q?=E3=81=A3=E3=81=A6=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- auth.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/auth.js b/auth.js index f9ff9f5..917e8ef 100644 --- a/auth.js +++ b/auth.js @@ -10,9 +10,7 @@ let authUser = async function authUser(cred) { //データからユーザー名とパスワード(ハッシュ化)を抽出 let username = cred.username; - let password = await bcrypt.hash(cred.password,10); - - console.log("auth :: authUser : ハッシュ化したpw->", password); + let password = cred.password; //それぞれのユーザーリストの中でパスワードが一致しているやつを探す for (let i=0; i Date: Tue, 4 Jul 2023 18:41:13 +0900 Subject: [PATCH 8/9] =?UTF-8?q?[fix]=20-=20=E5=B9=B3=E6=96=87=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E3=81=A0=E3=81=A3=E3=81=9F=E6=99=82=E3=81=AE=E3=83=8F?= =?UTF-8?q?=E3=83=83=E3=82=B7=E3=83=A5=E5=8C=96=E3=81=8C=E3=81=A7=E3=81=8D?= =?UTF-8?q?=E3=81=A6=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- auth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auth.js b/auth.js index 917e8ef..137ac87 100644 --- a/auth.js +++ b/auth.js @@ -45,7 +45,7 @@ let authUser = async function authUser(cred) { // !!!! ↓↓次期ビルドで削除↓↓ !!!! //パスワードが平文保存されているならハッシュ化して保存 - if ( db.dataUser.user[index].pw === cred.password ) { + if ( db.dataUser.user[index].pw === password ) { db.dataUser.user[index].pw = await bcrypt.hash(cred.password, 10); } From ae7a23c846469fabaace38f53fe1585172a60cd5 Mon Sep 17 00:00:00 2001 From: NfoAlex <40430040+NfoAlex@users.noreply.github.com> Date: Tue, 4 Jul 2023 18:50:26 +0900 Subject: [PATCH 9/9] =?UTF-8?q?[add]=20-=20=E3=83=91=E3=82=B9=E3=83=AF?= =?UTF-8?q?=E3=83=BC=E3=83=89=E5=A4=89=E6=9B=B4=E3=82=92=E3=83=8F=E3=83=83?= =?UTF-8?q?=E3=82=B7=E3=83=A5=E5=8C=96=E3=81=97=E3=81=9F=E3=82=82=E3=81=AE?= =?UTF-8?q?=E3=81=AB=E9=81=A9=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- auth.js | 13 ++++++++++--- index.js | 6 +++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/auth.js b/auth.js index 137ac87..503b23b 100644 --- a/auth.js +++ b/auth.js @@ -73,12 +73,19 @@ let authUser = async function authUser(cred) { } //パスワードを変更 -let changePassword = function changePassword(dat) { +let changePassword = async function changePassword(dat) { //今のパスワードが一致しないならここで停止 - if ( db.dataUser.user[dat.reqSender.userid].pw !== dat.currentPassword ) return -1; + if ( + db.dataUser.user[dat.reqSender.userid].pw !== dat.currentPassword && //平文でも比較 次期ビルドで削除 + !bcrypt.compare(dat.currentPassword, db.dataUser.user[dat.reqSender.userid].pw) + ) { + return -1; + } + + let newPassword = await bcrypt.hash(dat.newPassword, 10); //パスワード変更 - db.dataUser.user[dat.reqSender.userid].pw = dat.newPassword; + db.dataUser.user[dat.reqSender.userid].pw = newPassword; fs.writeFileSync("./user.json", JSON.stringify(db.dataUser, null, 4)); return 1; diff --git a/index.js b/index.js index d67c8b8..fa17974 100644 --- a/index.js +++ b/index.js @@ -950,7 +950,7 @@ io.on("connection", (socket) => { }); //パスワードを変更する - socket.on("changePassword", (dat) => { + socket.on("changePassword", async (dat) => { /* dat { @@ -967,9 +967,9 @@ io.on("connection", (socket) => { "newPassword" ]; - if ( !checkDataIntegrality(dat, paramRequire, "changeProfileSecurity") ) return -1 + if ( !checkDataIntegrality(dat, paramRequire, "changePassword") ) return -1 - let result = auth.changePassword(dat); + let result = await auth.changePassword(dat); //パスワードの変更結果を送信 socket.emit("changePasswordResult", result);