From 9107d791e2eef9a1b24b0499dac8b9dbba8a792f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 29 Apr 2020 09:04:42 +0200 Subject: Add external login tests --- .../peertube-plugin-test-external-auth-two/main.js | 31 ++++++++++++++++++++++ .../package.json | 20 ++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 server/tests/fixtures/peertube-plugin-test-external-auth-two/main.js create mode 100644 server/tests/fixtures/peertube-plugin-test-external-auth-two/package.json (limited to 'server/tests/fixtures/peertube-plugin-test-external-auth-two') diff --git a/server/tests/fixtures/peertube-plugin-test-external-auth-two/main.js b/server/tests/fixtures/peertube-plugin-test-external-auth-two/main.js new file mode 100644 index 000000000..34fec1bb3 --- /dev/null +++ b/server/tests/fixtures/peertube-plugin-test-external-auth-two/main.js @@ -0,0 +1,31 @@ +async function register ({ + registerExternalAuth, + peertubeHelpers +}) { + { + const result = registerExternalAuth({ + authName: 'external-auth-3', + authDisplayName: 'External Auth 3', + onAuthRequest: (req, res) => { + result.userAuthenticated({ + req, + res, + username: 'cid', + email: 'cid@example.com', + displayName: 'Cid Marquez' + }) + } + }) + } +} + +async function unregister () { + return +} + +module.exports = { + register, + unregister +} + +// ########################################################################### diff --git a/server/tests/fixtures/peertube-plugin-test-external-auth-two/package.json b/server/tests/fixtures/peertube-plugin-test-external-auth-two/package.json new file mode 100644 index 000000000..a5ca4d07a --- /dev/null +++ b/server/tests/fixtures/peertube-plugin-test-external-auth-two/package.json @@ -0,0 +1,20 @@ +{ + "name": "peertube-plugin-test-external-auth-two", + "version": "0.0.1", + "description": "External auth two", + "engine": { + "peertube": ">=1.3.0" + }, + "keywords": [ + "peertube", + "plugin" + ], + "homepage": "https://github.com/Chocobozzz/PeerTube", + "author": "Chocobozzz", + "bugs": "https://github.com/Chocobozzz/PeerTube/issues", + "library": "./main.js", + "staticDirs": {}, + "css": [], + "clientScripts": [], + "translations": {} +} -- cgit v1.2.3