diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-13 11:05:15 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:18 +0200 |
commit | 41d1d075011174e73dccb74006181a92a618d7b4 (patch) | |
tree | 4dc1af0e266977f062cf9716837d04de1cdd628d /shared/extra-utils/server | |
parent | 6c5065a011b099618681a37bd77eaa7bd3db752e (diff) | |
download | PeerTube-41d1d075011174e73dccb74006181a92a618d7b4.tar.gz PeerTube-41d1d075011174e73dccb74006181a92a618d7b4.tar.zst PeerTube-41d1d075011174e73dccb74006181a92a618d7b4.zip |
Introduce login command
Diffstat (limited to 'shared/extra-utils/server')
-rw-r--r-- | shared/extra-utils/server/clients.ts | 20 | ||||
-rw-r--r-- | shared/extra-utils/server/servers.ts | 4 |
2 files changed, 3 insertions, 21 deletions
diff --git a/shared/extra-utils/server/clients.ts b/shared/extra-utils/server/clients.ts deleted file mode 100644 index 894fe4911..000000000 --- a/shared/extra-utils/server/clients.ts +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | import * as request from 'supertest' | ||
2 | import { URL } from 'url' | ||
3 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' | ||
4 | |||
5 | function getClient (url: string) { | ||
6 | const path = '/api/v1/oauth-clients/local' | ||
7 | |||
8 | return request(url) | ||
9 | .get(path) | ||
10 | .set('Host', new URL(url).host) | ||
11 | .set('Accept', 'application/json') | ||
12 | .expect(HttpStatusCode.OK_200) | ||
13 | .expect('Content-Type', /json/) | ||
14 | } | ||
15 | |||
16 | // --------------------------------------------------------------------------- | ||
17 | |||
18 | export { | ||
19 | getClient | ||
20 | } | ||
diff --git a/shared/extra-utils/server/servers.ts b/shared/extra-utils/server/servers.ts index f5dc0326f..4d9599680 100644 --- a/shared/extra-utils/server/servers.ts +++ b/shared/extra-utils/server/servers.ts | |||
@@ -16,7 +16,7 @@ import { AbusesCommand } from '../moderation' | |||
16 | import { OverviewsCommand } from '../overviews' | 16 | import { OverviewsCommand } from '../overviews' |
17 | import { SearchCommand } from '../search' | 17 | import { SearchCommand } from '../search' |
18 | import { SocketIOCommand } from '../socket' | 18 | import { SocketIOCommand } from '../socket' |
19 | import { AccountsCommand, BlocklistCommand, NotificationsCommand, SubscriptionsCommand } from '../users' | 19 | import { AccountsCommand, BlocklistCommand, LoginCommand, NotificationsCommand, SubscriptionsCommand } from '../users' |
20 | import { | 20 | import { |
21 | BlacklistCommand, | 21 | BlacklistCommand, |
22 | CaptionsCommand, | 22 | CaptionsCommand, |
@@ -126,6 +126,7 @@ interface ServerInfo { | |||
126 | sqlCommand?: SQLCommand | 126 | sqlCommand?: SQLCommand |
127 | notificationsCommand?: NotificationsCommand | 127 | notificationsCommand?: NotificationsCommand |
128 | serversCommand?: ServersCommand | 128 | serversCommand?: ServersCommand |
129 | loginCommand?: LoginCommand | ||
129 | } | 130 | } |
130 | 131 | ||
131 | function flushAndRunMultipleServers (totalServers: number, configOverride?: Object) { | 132 | function flushAndRunMultipleServers (totalServers: number, configOverride?: Object) { |
@@ -357,6 +358,7 @@ function assignCommands (server: ServerInfo) { | |||
357 | server.sqlCommand = new SQLCommand(server) | 358 | server.sqlCommand = new SQLCommand(server) |
358 | server.notificationsCommand = new NotificationsCommand(server) | 359 | server.notificationsCommand = new NotificationsCommand(server) |
359 | server.serversCommand = new ServersCommand(server) | 360 | server.serversCommand = new ServersCommand(server) |
361 | server.loginCommand = new LoginCommand(server) | ||
360 | } | 362 | } |
361 | 363 | ||
362 | async function reRunServer (server: ServerInfo, configOverride?: any) { | 364 | async function reRunServer (server: ServerInfo, configOverride?: any) { |