aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--package.json2
-rw-r--r--server/lib/auth/oauth-model.ts2
-rw-r--r--server/lib/auth/oauth.ts7
-rw-r--r--yarn.lock43
4 files changed, 26 insertions, 28 deletions
diff --git a/package.json b/package.json
index 93fa4b04a..6a5bcf75c 100644
--- a/package.json
+++ b/package.json
@@ -84,6 +84,7 @@
84 "@aws-sdk/lib-storage": "^3.72.0", 84 "@aws-sdk/lib-storage": "^3.72.0",
85 "@aws-sdk/node-http-handler": "^3.82.0", 85 "@aws-sdk/node-http-handler": "^3.82.0",
86 "@babel/parser": "7.17.8", 86 "@babel/parser": "7.17.8",
87 "@node-oauth/oauth2-server": "^4.2.0",
87 "@peertube/feed": "^5.0.1", 88 "@peertube/feed": "^5.0.1",
88 "@peertube/http-signature": "^1.6.0", 89 "@peertube/http-signature": "^1.6.0",
89 "@uploadx/core": "^5.1.2", 90 "@uploadx/core": "^5.1.2",
@@ -132,7 +133,6 @@
132 "multer": "^1.4.5-lts.1", 133 "multer": "^1.4.5-lts.1",
133 "node-media-server": "^2.1.4", 134 "node-media-server": "^2.1.4",
134 "nodemailer": "^6.0.0", 135 "nodemailer": "^6.0.0",
135 "oauth2-server": "3.1.1",
136 "parse-torrent": "^9.1.0", 136 "parse-torrent": "^9.1.0",
137 "password-generator": "^2.0.2", 137 "password-generator": "^2.0.2",
138 "pem": "^1.12.3", 138 "pem": "^1.12.3",
diff --git a/server/lib/auth/oauth-model.ts b/server/lib/auth/oauth-model.ts
index 910fdeec1..d9cf32827 100644
--- a/server/lib/auth/oauth-model.ts
+++ b/server/lib/auth/oauth-model.ts
@@ -1,5 +1,5 @@
1import express from 'express' 1import express from 'express'
2import { AccessDeniedError } from 'oauth2-server' 2import { AccessDeniedError } from '@node-oauth/oauth2-server'
3import { PluginManager } from '@server/lib/plugins/plugin-manager' 3import { PluginManager } from '@server/lib/plugins/plugin-manager'
4import { ActorModel } from '@server/models/actor/actor' 4import { ActorModel } from '@server/models/actor/actor'
5import { MOAuthClient } from '@server/types/models' 5import { MOAuthClient } from '@server/types/models'
diff --git a/server/lib/auth/oauth.ts b/server/lib/auth/oauth.ts
index 2bf7a6361..fa1887315 100644
--- a/server/lib/auth/oauth.ts
+++ b/server/lib/auth/oauth.ts
@@ -1,5 +1,5 @@
1import express from 'express' 1import express from 'express'
2import { 2import OAuth2Server, {
3 InvalidClientError, 3 InvalidClientError,
4 InvalidGrantError, 4 InvalidGrantError,
5 InvalidRequestError, 5 InvalidRequestError,
@@ -7,7 +7,7 @@ import {
7 Response, 7 Response,
8 UnauthorizedClientError, 8 UnauthorizedClientError,
9 UnsupportedGrantTypeError 9 UnsupportedGrantTypeError
10} from 'oauth2-server' 10} from '@node-oauth/oauth2-server'
11import { randomBytesPromise } from '@server/helpers/core-utils' 11import { randomBytesPromise } from '@server/helpers/core-utils'
12import { MOAuthClient } from '@server/types/models' 12import { MOAuthClient } from '@server/types/models'
13import { sha1 } from '@shared/extra-utils' 13import { sha1 } from '@shared/extra-utils'
@@ -19,8 +19,7 @@ import { BypassLogin, getClient, getRefreshToken, getUser, revokeToken, saveToke
19 * Reimplement some functions of OAuth2Server to inject external auth methods 19 * Reimplement some functions of OAuth2Server to inject external auth methods
20 * 20 *
21 */ 21 */
22 22const oAuthServer = new OAuth2Server({
23const oAuthServer = new (require('oauth2-server'))({
24 accessTokenLifetime: OAUTH_LIFETIME.ACCESS_TOKEN, 23 accessTokenLifetime: OAUTH_LIFETIME.ACCESS_TOKEN,
25 refreshTokenLifetime: OAUTH_LIFETIME.REFRESH_TOKEN, 24 refreshTokenLifetime: OAUTH_LIFETIME.REFRESH_TOKEN,
26 25
diff --git a/yarn.lock b/yarn.lock
index a0519d54e..4d9b5b4bd 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1569,6 +1569,22 @@
1569 resolved "https://registry.yarnpkg.com/@msgpackr-extract/msgpackr-extract-win32-x64/-/msgpackr-extract-win32-x64-2.0.2.tgz#baea7764b1adf201ce4a792fe971fd7211dad2e4" 1569 resolved "https://registry.yarnpkg.com/@msgpackr-extract/msgpackr-extract-win32-x64/-/msgpackr-extract-win32-x64-2.0.2.tgz#baea7764b1adf201ce4a792fe971fd7211dad2e4"
1570 integrity sha512-fpnI00dt+yO1cKx9qBXelKhPBdEgvc8ZPav1+0r09j0woYQU2N79w/jcGawSY5UGlgQ3vjaJsFHnGbGvvqdLzg== 1570 integrity sha512-fpnI00dt+yO1cKx9qBXelKhPBdEgvc8ZPav1+0r09j0woYQU2N79w/jcGawSY5UGlgQ3vjaJsFHnGbGvvqdLzg==
1571 1571
1572"@node-oauth/formats@^1.0.0":
1573 version "1.0.0"
1574 resolved "https://registry.yarnpkg.com/@node-oauth/formats/-/formats-1.0.0.tgz#6525478802180199ecf6ea3208fc5e1b683031be"
1575 integrity sha512-DwSbLtdC8zC5B5gTJkFzJj5s9vr9SGzOgQvV9nH7tUVuMSScg0EswAczhjIapOmH3Y8AyP7C4Jv7b8+QJObWZA==
1576
1577"@node-oauth/oauth2-server@^4.2.0":
1578 version "4.2.0"
1579 resolved "https://registry.yarnpkg.com/@node-oauth/oauth2-server/-/oauth2-server-4.2.0.tgz#6817b137018f8fceafa8fc7bddf66766251b3116"
1580 integrity sha512-4nMcdCp3JNhhJAIjYou49QNcFZZdZ//kC7igrCw1Etlqhdz38hgLEUDXFpyGYQszVK9fg5HRIgR9e6mFaxiUEw==
1581 dependencies:
1582 "@node-oauth/formats" "^1.0.0"
1583 basic-auth "2.0.1"
1584 bluebird "3.7.2"
1585 promisify-any "2.0.1"
1586 type-is "1.6.18"
1587
1572"@nodelib/fs.scandir@2.1.5": 1588"@nodelib/fs.scandir@2.1.5":
1573 version "2.1.5" 1589 version "2.1.5"
1574 resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" 1590 resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5"
@@ -5889,11 +5905,6 @@ lodash.merge@^4.6.2:
5889 resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" 5905 resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a"
5890 integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== 5906 integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==
5891 5907
5892lodash@4.17.19:
5893 version "4.17.19"
5894 resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b"
5895 integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==
5896
5897lodash@>=4.17.13, lodash@^4.17.10, lodash@^4.17.20, lodash@^4.17.21: 5908lodash@>=4.17.13, lodash@^4.17.10, lodash@^4.17.20, lodash@^4.17.21:
5898 version "4.17.21" 5909 version "4.17.21"
5899 resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" 5910 resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
@@ -6610,18 +6621,6 @@ nth-check@^2.0.1:
6610 dependencies: 6621 dependencies:
6611 boolbase "^1.0.0" 6622 boolbase "^1.0.0"
6612 6623
6613oauth2-server@3.1.1:
6614 version "3.1.1"
6615 resolved "https://registry.yarnpkg.com/oauth2-server/-/oauth2-server-3.1.1.tgz#be291da840a307a50368736ab766bd68f2eeb3a9"
6616 integrity sha512-4dv+fE9hrK+xTaCygOLh/kQeFzbFr7UqSyHvBDbrQq8Hg52sAkV2vTsyH3Z42hoeaKpbhM7udhL8Y4GYbl6TGQ==
6617 dependencies:
6618 basic-auth "2.0.1"
6619 bluebird "3.7.2"
6620 lodash "4.17.19"
6621 promisify-any "2.0.1"
6622 statuses "1.5.0"
6623 type-is "1.6.18"
6624
6625object-assign@^4, object-assign@^4.1.1: 6624object-assign@^4, object-assign@^4.1.1:
6626 version "4.1.1" 6625 version "4.1.1"
6627 resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" 6626 resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
@@ -8180,16 +8179,16 @@ standard-as-callback@^2.1.0:
8180 resolved "https://registry.yarnpkg.com/standard-as-callback/-/standard-as-callback-2.1.0.tgz#8953fc05359868a77b5b9739a665c5977bb7df45" 8179 resolved "https://registry.yarnpkg.com/standard-as-callback/-/standard-as-callback-2.1.0.tgz#8953fc05359868a77b5b9739a665c5977bb7df45"
8181 integrity sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A== 8180 integrity sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==
8182 8181
8183statuses@1.5.0, "statuses@>= 1.5.0 < 2":
8184 version "1.5.0"
8185 resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
8186 integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==
8187
8188statuses@2.0.1: 8182statuses@2.0.1:
8189 version "2.0.1" 8183 version "2.0.1"
8190 resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" 8184 resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63"
8191 integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== 8185 integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==
8192 8186
8187"statuses@>= 1.5.0 < 2":
8188 version "1.5.0"
8189 resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
8190 integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==
8191
8193stream-browserify@3.0.0: 8192stream-browserify@3.0.0:
8194 version "3.0.0" 8193 version "3.0.0"
8195 resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-3.0.0.tgz#22b0a2850cdf6503e73085da1fc7b7d0c2122f2f" 8194 resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-3.0.0.tgz#22b0a2850cdf6503e73085da1fc7b7d0c2122f2f"