diff options
Diffstat (limited to 'shared/extra-utils/server/plugins.ts')
-rw-r--r-- | shared/extra-utils/server/plugins.ts | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/shared/extra-utils/server/plugins.ts b/shared/extra-utils/server/plugins.ts index 2d02d823d..b6b5e3958 100644 --- a/shared/extra-utils/server/plugins.ts +++ b/shared/extra-utils/server/plugins.ts | |||
@@ -235,6 +235,27 @@ function getPluginTestPath (suffix = '') { | |||
235 | return join(root(), 'server', 'tests', 'fixtures', 'peertube-plugin-test' + suffix) | 235 | return join(root(), 'server', 'tests', 'fixtures', 'peertube-plugin-test' + suffix) |
236 | } | 236 | } |
237 | 237 | ||
238 | function getExternalAuth (options: { | ||
239 | url: string | ||
240 | npmName: string | ||
241 | npmVersion: string | ||
242 | authName: string | ||
243 | query?: any | ||
244 | statusCodeExpected?: number | ||
245 | }) { | ||
246 | const { url, npmName, npmVersion, authName, statusCodeExpected, query } = options | ||
247 | |||
248 | const path = '/plugins/' + npmName + '/' + npmVersion + '/auth/' + authName | ||
249 | |||
250 | return makeGetRequest({ | ||
251 | url, | ||
252 | path, | ||
253 | query, | ||
254 | statusCodeExpected: statusCodeExpected || 200, | ||
255 | redirects: 0 | ||
256 | }) | ||
257 | } | ||
258 | |||
238 | export { | 259 | export { |
239 | listPlugins, | 260 | listPlugins, |
240 | listAvailablePlugins, | 261 | listAvailablePlugins, |
@@ -250,5 +271,6 @@ export { | |||
250 | updatePluginPackageJSON, | 271 | updatePluginPackageJSON, |
251 | getPluginPackageJSON, | 272 | getPluginPackageJSON, |
252 | getPluginTestPath, | 273 | getPluginTestPath, |
253 | getPublicSettings | 274 | getPublicSettings, |
275 | getExternalAuth | ||
254 | } | 276 | } |