aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/server/plugins.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-04-29 09:04:42 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-05-04 16:21:39 +0200
commit9107d791e2eef9a1b24b0499dac8b9dbba8a792f (patch)
treef09b20f06008b094f3266b39063bc9785dfebf5f /shared/extra-utils/server/plugins.ts
parent4a8d113b9b57d97ff13ad1608798eabca99643e4 (diff)
downloadPeerTube-9107d791e2eef9a1b24b0499dac8b9dbba8a792f.tar.gz
PeerTube-9107d791e2eef9a1b24b0499dac8b9dbba8a792f.tar.zst
PeerTube-9107d791e2eef9a1b24b0499dac8b9dbba8a792f.zip
Add external login tests
Diffstat (limited to 'shared/extra-utils/server/plugins.ts')
-rw-r--r--shared/extra-utils/server/plugins.ts24
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
238function 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
238export { 259export {
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}