aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/server
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-08 10:55:16 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:17 +0200
commita1637fa1e25b60a88f7cfe50aac8953f50d55761 (patch)
tree4d0cc82eef618619a7bcb747812cc7b21e0d8776 /shared/extra-utils/server
parent04aed76711909507e74905bde3a7fa024d3585c9 (diff)
downloadPeerTube-a1637fa1e25b60a88f7cfe50aac8953f50d55761.tar.gz
PeerTube-a1637fa1e25b60a88f7cfe50aac8953f50d55761.tar.zst
PeerTube-a1637fa1e25b60a88f7cfe50aac8953f50d55761.zip
Specify if we want to fallback to the server token
Diffstat (limited to 'shared/extra-utils/server')
-rw-r--r--shared/extra-utils/server/config-command.ts7
-rw-r--r--shared/extra-utils/server/contact-form-command.ts2
-rw-r--r--shared/extra-utils/server/debug-command.ts2
-rw-r--r--shared/extra-utils/server/follows-command.ts11
-rw-r--r--shared/extra-utils/server/jobs-command.ts1
-rw-r--r--shared/extra-utils/server/plugins-command.ts12
-rw-r--r--shared/extra-utils/server/redundancy-command.ts4
-rw-r--r--shared/extra-utils/server/stats-command.ts1
8 files changed, 33 insertions, 7 deletions
diff --git a/shared/extra-utils/server/config-command.ts b/shared/extra-utils/server/config-command.ts
index 959848706..f5d7fc5e3 100644
--- a/shared/extra-utils/server/config-command.ts
+++ b/shared/extra-utils/server/config-command.ts
@@ -24,8 +24,8 @@ export class ConfigCommand extends AbstractCommand {
24 return this.getRequestBody<ServerConfig>({ 24 return this.getRequestBody<ServerConfig>({
25 ...options, 25 ...options,
26 26
27 token: null,
28 path, 27 path,
28 implicitToken: false,
29 defaultExpectedStatus: HttpStatusCode.OK_200 29 defaultExpectedStatus: HttpStatusCode.OK_200
30 }) 30 })
31 } 31 }
@@ -36,8 +36,8 @@ export class ConfigCommand extends AbstractCommand {
36 return this.getRequestBody<About>({ 36 return this.getRequestBody<About>({
37 ...options, 37 ...options,
38 38
39 token: null,
40 path, 39 path,
40 implicitToken: false,
41 defaultExpectedStatus: HttpStatusCode.OK_200 41 defaultExpectedStatus: HttpStatusCode.OK_200
42 }) 42 })
43 } 43 }
@@ -49,6 +49,7 @@ export class ConfigCommand extends AbstractCommand {
49 ...options, 49 ...options,
50 50
51 path, 51 path,
52 implicitToken: true,
52 defaultExpectedStatus: HttpStatusCode.OK_200 53 defaultExpectedStatus: HttpStatusCode.OK_200
53 }) 54 })
54 } 55 }
@@ -63,6 +64,7 @@ export class ConfigCommand extends AbstractCommand {
63 64
64 path, 65 path,
65 fields: options.newCustomConfig, 66 fields: options.newCustomConfig,
67 implicitToken: true,
66 defaultExpectedStatus: HttpStatusCode.OK_200 68 defaultExpectedStatus: HttpStatusCode.OK_200
67 }) 69 })
68 } 70 }
@@ -74,6 +76,7 @@ export class ConfigCommand extends AbstractCommand {
74 ...options, 76 ...options,
75 77
76 path, 78 path,
79 implicitToken: true,
77 defaultExpectedStatus: HttpStatusCode.OK_200 80 defaultExpectedStatus: HttpStatusCode.OK_200
78 }) 81 })
79 } 82 }
diff --git a/shared/extra-utils/server/contact-form-command.ts b/shared/extra-utils/server/contact-form-command.ts
index 943e5ccbb..8d034552b 100644
--- a/shared/extra-utils/server/contact-form-command.ts
+++ b/shared/extra-utils/server/contact-form-command.ts
@@ -23,8 +23,8 @@ export class ContactFormCommand extends AbstractCommand {
23 ...options, 23 ...options,
24 24
25 path, 25 path,
26 token: null,
27 fields: body, 26 fields: body,
27 implicitToken: false,
28 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 28 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
29 }) 29 })
30 } 30 }
diff --git a/shared/extra-utils/server/debug-command.ts b/shared/extra-utils/server/debug-command.ts
index eecbb1711..8b24b3067 100644
--- a/shared/extra-utils/server/debug-command.ts
+++ b/shared/extra-utils/server/debug-command.ts
@@ -11,6 +11,7 @@ export class DebugCommand extends AbstractCommand {
11 ...options, 11 ...options,
12 12
13 path, 13 path,
14 implicitToken: true,
14 defaultExpectedStatus: HttpStatusCode.OK_200 15 defaultExpectedStatus: HttpStatusCode.OK_200
15 }) 16 })
16 } 17 }
@@ -26,6 +27,7 @@ export class DebugCommand extends AbstractCommand {
26 27
27 path, 28 path,
28 fields: body, 29 fields: body,
30 implicitToken: true,
29 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 31 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
30 }) 32 })
31 } 33 }
diff --git a/shared/extra-utils/server/follows-command.ts b/shared/extra-utils/server/follows-command.ts
index aba7bce82..4e1e56d7a 100644
--- a/shared/extra-utils/server/follows-command.ts
+++ b/shared/extra-utils/server/follows-command.ts
@@ -22,10 +22,9 @@ export class FollowsCommand extends AbstractCommand {
22 return this.getRequestBody<ResultList<ActorFollow>>({ 22 return this.getRequestBody<ResultList<ActorFollow>>({
23 ...options, 23 ...options,
24 24
25 token: null,
26
27 path, 25 path,
28 query, 26 query,
27 implicitToken: false,
29 defaultExpectedStatus: HttpStatusCode.OK_200 28 defaultExpectedStatus: HttpStatusCode.OK_200
30 }) 29 })
31 } 30 }
@@ -46,10 +45,9 @@ export class FollowsCommand extends AbstractCommand {
46 return this.getRequestBody<ResultList<ActorFollow>>({ 45 return this.getRequestBody<ResultList<ActorFollow>>({
47 ...options, 46 ...options,
48 47
49 token: null,
50
51 path, 48 path,
52 query, 49 query,
50 implicitToken: false,
53 defaultExpectedStatus: HttpStatusCode.OK_200 51 defaultExpectedStatus: HttpStatusCode.OK_200
54 }) 52 })
55 } 53 }
@@ -66,6 +64,7 @@ export class FollowsCommand extends AbstractCommand {
66 64
67 path, 65 path,
68 fields: { hosts }, 66 fields: { hosts },
67 implicitToken: true,
69 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 68 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
70 }) 69 })
71 } 70 }
@@ -79,6 +78,7 @@ export class FollowsCommand extends AbstractCommand {
79 ...options, 78 ...options,
80 79
81 path, 80 path,
81 implicitToken: true,
82 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 82 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
83 }) 83 })
84 } 84 }
@@ -92,6 +92,7 @@ export class FollowsCommand extends AbstractCommand {
92 ...options, 92 ...options,
93 93
94 path, 94 path,
95 implicitToken: true,
95 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 96 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
96 }) 97 })
97 } 98 }
@@ -105,6 +106,7 @@ export class FollowsCommand extends AbstractCommand {
105 ...options, 106 ...options,
106 107
107 path, 108 path,
109 implicitToken: true,
108 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 110 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
109 }) 111 })
110 } 112 }
@@ -118,6 +120,7 @@ export class FollowsCommand extends AbstractCommand {
118 ...options, 120 ...options,
119 121
120 path, 122 path,
123 implicitToken: true,
121 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 124 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
122 }) 125 })
123 } 126 }
diff --git a/shared/extra-utils/server/jobs-command.ts b/shared/extra-utils/server/jobs-command.ts
index 758b4a4af..392b868c1 100644
--- a/shared/extra-utils/server/jobs-command.ts
+++ b/shared/extra-utils/server/jobs-command.ts
@@ -21,6 +21,7 @@ export class JobsCommand extends AbstractCommand {
21 21
22 path, 22 path,
23 query, 23 query,
24 implicitToken: true,
24 defaultExpectedStatus: HttpStatusCode.OK_200 25 defaultExpectedStatus: HttpStatusCode.OK_200
25 }) 26 })
26 } 27 }
diff --git a/shared/extra-utils/server/plugins-command.ts b/shared/extra-utils/server/plugins-command.ts
index f06e58a22..ff49d58c4 100644
--- a/shared/extra-utils/server/plugins-command.ts
+++ b/shared/extra-utils/server/plugins-command.ts
@@ -45,6 +45,7 @@ export class PluginsCommand extends AbstractCommand {
45 pluginType, 45 pluginType,
46 uninstalled 46 uninstalled
47 }, 47 },
48 implicitToken: true,
48 defaultExpectedStatus: HttpStatusCode.OK_200 49 defaultExpectedStatus: HttpStatusCode.OK_200
49 }) 50 })
50 } 51 }
@@ -75,6 +76,7 @@ export class PluginsCommand extends AbstractCommand {
75 76
76 path, 77 path,
77 query, 78 query,
79 implicitToken: true,
78 defaultExpectedStatus: HttpStatusCode.OK_200 80 defaultExpectedStatus: HttpStatusCode.OK_200
79 }) 81 })
80 } 82 }
@@ -88,6 +90,7 @@ export class PluginsCommand extends AbstractCommand {
88 ...options, 90 ...options,
89 91
90 path, 92 path,
93 implicitToken: true,
91 defaultExpectedStatus: HttpStatusCode.OK_200 94 defaultExpectedStatus: HttpStatusCode.OK_200
92 }) 95 })
93 } 96 }
@@ -104,6 +107,7 @@ export class PluginsCommand extends AbstractCommand {
104 107
105 path, 108 path,
106 fields: { settings }, 109 fields: { settings },
110 implicitToken: true,
107 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 111 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
108 }) 112 })
109 } 113 }
@@ -117,6 +121,7 @@ export class PluginsCommand extends AbstractCommand {
117 ...options, 121 ...options,
118 122
119 path, 123 path,
124 implicitToken: true,
120 defaultExpectedStatus: HttpStatusCode.OK_200 125 defaultExpectedStatus: HttpStatusCode.OK_200
121 }) 126 })
122 } 127 }
@@ -131,6 +136,7 @@ export class PluginsCommand extends AbstractCommand {
131 ...options, 136 ...options,
132 137
133 path, 138 path,
139 implicitToken: false,
134 defaultExpectedStatus: HttpStatusCode.OK_200 140 defaultExpectedStatus: HttpStatusCode.OK_200
135 }) 141 })
136 } 142 }
@@ -145,6 +151,7 @@ export class PluginsCommand extends AbstractCommand {
145 ...options, 151 ...options,
146 152
147 path, 153 path,
154 implicitToken: false,
148 defaultExpectedStatus: HttpStatusCode.OK_200 155 defaultExpectedStatus: HttpStatusCode.OK_200
149 }) 156 })
150 } 157 }
@@ -161,6 +168,7 @@ export class PluginsCommand extends AbstractCommand {
161 168
162 path: apiPath, 169 path: apiPath,
163 fields: { npmName, path }, 170 fields: { npmName, path },
171 implicitToken: true,
164 defaultExpectedStatus: HttpStatusCode.OK_200 172 defaultExpectedStatus: HttpStatusCode.OK_200
165 }) 173 })
166 } 174 }
@@ -177,6 +185,7 @@ export class PluginsCommand extends AbstractCommand {
177 185
178 path: apiPath, 186 path: apiPath,
179 fields: { npmName, path }, 187 fields: { npmName, path },
188 implicitToken: true,
180 defaultExpectedStatus: HttpStatusCode.OK_200 189 defaultExpectedStatus: HttpStatusCode.OK_200
181 }) 190 })
182 } 191 }
@@ -192,6 +201,7 @@ export class PluginsCommand extends AbstractCommand {
192 201
193 path: apiPath, 202 path: apiPath,
194 fields: { npmName }, 203 fields: { npmName },
204 implicitToken: true,
195 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 205 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
196 }) 206 })
197 } 207 }
@@ -203,6 +213,7 @@ export class PluginsCommand extends AbstractCommand {
203 ...options, 213 ...options,
204 214
205 path, 215 path,
216 implicitToken: false,
206 defaultExpectedStatus: HttpStatusCode.OK_200 217 defaultExpectedStatus: HttpStatusCode.OK_200
207 }) 218 })
208 } 219 }
@@ -222,6 +233,7 @@ export class PluginsCommand extends AbstractCommand {
222 233
223 path, 234 path,
224 query, 235 query,
236 implicitToken: false,
225 defaultExpectedStatus: HttpStatusCode.OK_200, 237 defaultExpectedStatus: HttpStatusCode.OK_200,
226 redirects: 0 238 redirects: 0
227 }) 239 })
diff --git a/shared/extra-utils/server/redundancy-command.ts b/shared/extra-utils/server/redundancy-command.ts
index d717d35f8..728332fdd 100644
--- a/shared/extra-utils/server/redundancy-command.ts
+++ b/shared/extra-utils/server/redundancy-command.ts
@@ -16,6 +16,7 @@ export class RedundancyCommand extends AbstractCommand {
16 16
17 path, 17 path,
18 fields: { redundancyAllowed }, 18 fields: { redundancyAllowed },
19 implicitToken: true,
19 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 20 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
20 }) 21 })
21 } 22 }
@@ -42,6 +43,7 @@ export class RedundancyCommand extends AbstractCommand {
42 target 43 target
43 }, 44 },
44 45
46 implicitToken: true,
45 defaultExpectedStatus: HttpStatusCode.OK_200 47 defaultExpectedStatus: HttpStatusCode.OK_200
46 }) 48 })
47 } 49 }
@@ -57,6 +59,7 @@ export class RedundancyCommand extends AbstractCommand {
57 59
58 path, 60 path,
59 fields: { videoId }, 61 fields: { videoId },
62 implicitToken: true,
60 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 63 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
61 }) 64 })
62 } 65 }
@@ -71,6 +74,7 @@ export class RedundancyCommand extends AbstractCommand {
71 ...options, 74 ...options,
72 75
73 path, 76 path,
77 implicitToken: true,
74 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 78 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
75 }) 79 })
76 } 80 }
diff --git a/shared/extra-utils/server/stats-command.ts b/shared/extra-utils/server/stats-command.ts
index b51d9ceef..f0f02ca08 100644
--- a/shared/extra-utils/server/stats-command.ts
+++ b/shared/extra-utils/server/stats-command.ts
@@ -19,6 +19,7 @@ export class StatsCommand extends AbstractCommand {
19 19
20 path, 20 path,
21 query, 21 query,
22 implicitToken: false,
22 defaultExpectedStatus: HttpStatusCode.OK_200 23 defaultExpectedStatus: HttpStatusCode.OK_200
23 }) 24 })
24 } 25 }