aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/plugins/id-and-pass-auth.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-04-30 10:03:09 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-05-04 16:21:39 +0200
commita4995eb7ac5745f62604d70f7b2225ff33916d49 (patch)
tree2dbed723d3f5a539e8f0847d914723cd7543b1b2 /server/tests/plugins/id-and-pass-auth.ts
parente9b0fa5c16ca196a3ba3267af4008782a3e86875 (diff)
downloadPeerTube-a4995eb7ac5745f62604d70f7b2225ff33916d49.tar.gz
PeerTube-a4995eb7ac5745f62604d70f7b2225ff33916d49.tar.zst
PeerTube-a4995eb7ac5745f62604d70f7b2225ff33916d49.zip
Add ability to unregister plugin auths
Diffstat (limited to 'server/tests/plugins/id-and-pass-auth.ts')
-rw-r--r--server/tests/plugins/id-and-pass-auth.ts26
1 files changed, 25 insertions, 1 deletions
diff --git a/server/tests/plugins/id-and-pass-auth.ts b/server/tests/plugins/id-and-pass-auth.ts
index 6c10730aa..97df4c1fd 100644
--- a/server/tests/plugins/id-and-pass-auth.ts
+++ b/server/tests/plugins/id-and-pass-auth.ts
@@ -12,7 +12,7 @@ import {
12 updateMyUser, 12 updateMyUser,
13 userLogin, 13 userLogin,
14 wait, 14 wait,
15 login, refreshToken, getConfig 15 login, refreshToken, getConfig, updatePluginSettings
16} from '../../../shared/extra-utils' 16} from '../../../shared/extra-utils'
17import { User, UserRole, ServerConfig } from '@shared/models' 17import { User, UserRole, ServerConfig } from '@shared/models'
18import { expect } from 'chai' 18import { expect } from 'chai'
@@ -179,6 +179,30 @@ describe('Test id and pass auth plugins', function () {
179 await waitUntilLog(server, 'valid email') 179 await waitUntilLog(server, 'valid email')
180 }) 180 })
181 181
182 it('Should unregister spyro-auth and do not login existing Spyro', async function () {
183 await updatePluginSettings({
184 url: server.url,
185 accessToken: server.accessToken,
186 npmName: 'peertube-plugin-test-id-pass-auth-one',
187 settings: { disableSpyro: true }
188 })
189
190 await userLogin(server, { username: 'spyro', password: 'spyro password' }, 400)
191 await userLogin(server, { username: 'spyro', password: 'fake' }, 400)
192 })
193
194 it('Should have disabled this auth', async function () {
195 const res = await getConfig(server.url)
196
197 const config: ServerConfig = res.body
198
199 const auths = config.plugin.registeredIdAndPassAuths
200 expect(auths).to.have.lengthOf(7)
201
202 const spyroAuth = auths.find(a => a.authName === 'spyro-auth')
203 expect(spyroAuth).to.not.exist
204 })
205
182 it('Should uninstall the plugin one and do not login existing Crash', async function () { 206 it('Should uninstall the plugin one and do not login existing Crash', async function () {
183 await uninstallPlugin({ 207 await uninstallPlugin({
184 url: server.url, 208 url: server.url,