X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fextra-utils%2Fserver%2Fplugins.ts;h=b6b5e395826f648ec74016c80ba29a8a1aae380e;hb=5baee5fca418487e72ddcd6419d31bca8659b668;hp=2d02d823d5f176f1030b6e730ebefd40630243bc;hpb=c2777c1dfe688c8fab1ef2fed50e360100fa9198;p=github%2FChocobozzz%2FPeerTube.git 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 = '') { return join(root(), 'server', 'tests', 'fixtures', 'peertube-plugin-test' + suffix) } +function getExternalAuth (options: { + url: string + npmName: string + npmVersion: string + authName: string + query?: any + statusCodeExpected?: number +}) { + const { url, npmName, npmVersion, authName, statusCodeExpected, query } = options + + const path = '/plugins/' + npmName + '/' + npmVersion + '/auth/' + authName + + return makeGetRequest({ + url, + path, + query, + statusCodeExpected: statusCodeExpected || 200, + redirects: 0 + }) +} + export { listPlugins, listAvailablePlugins, @@ -250,5 +271,6 @@ export { updatePluginPackageJSON, getPluginPackageJSON, getPluginTestPath, - getPublicSettings + getPublicSettings, + getExternalAuth }