aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-12-29 15:31:40 +0100
committerChocobozzz <me@florianbigard.com>2023-01-04 11:41:29 +0100
commit7e0c26066a5c59af742ae56bddaff9635debe034 (patch)
tree405a97a1c8a7c79c62c620406e6556d2c53c4d97 /server/tests
parentb65f5367baf799b425be0bcfb9220922751bb6eb (diff)
downloadPeerTube-7e0c26066a5c59af742ae56bddaff9635debe034.tar.gz
PeerTube-7e0c26066a5c59af742ae56bddaff9635debe034.tar.zst
PeerTube-7e0c26066a5c59af742ae56bddaff9635debe034.zip
External auth can set more user fields
videoQuota, videoQuotaDaily, adminFlags
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/fixtures/peertube-plugin-test-external-auth-one/main.js5
-rw-r--r--server/tests/plugins/external-auth.ts8
2 files changed, 11 insertions, 2 deletions
diff --git a/server/tests/fixtures/peertube-plugin-test-external-auth-one/main.js b/server/tests/fixtures/peertube-plugin-test-external-auth-one/main.js
index c65b8d3a8..cdbaf11ac 100644
--- a/server/tests/fixtures/peertube-plugin-test-external-auth-one/main.js
+++ b/server/tests/fixtures/peertube-plugin-test-external-auth-one/main.js
@@ -33,7 +33,10 @@ async function register ({
33 username: 'kefka', 33 username: 'kefka',
34 email: 'kefka@example.com', 34 email: 'kefka@example.com',
35 role: 0, 35 role: 0,
36 displayName: 'Kefka Palazzo' 36 displayName: 'Kefka Palazzo',
37 adminFlags: 1,
38 videoQuota: 42000,
39 videoQuotaDaily: 42100
37 }) 40 })
38 }, 41 },
39 hookTokenValidity: (options) => { 42 hookTokenValidity: (options) => {
diff --git a/server/tests/plugins/external-auth.ts b/server/tests/plugins/external-auth.ts
index 437777e90..ee78ae5aa 100644
--- a/server/tests/plugins/external-auth.ts
+++ b/server/tests/plugins/external-auth.ts
@@ -2,7 +2,7 @@
2 2
3import { expect } from 'chai' 3import { expect } from 'chai'
4import { wait } from '@shared/core-utils' 4import { wait } from '@shared/core-utils'
5import { HttpStatusCode, UserRole } from '@shared/models' 5import { HttpStatusCode, UserAdminFlag, UserRole } from '@shared/models'
6import { 6import {
7 cleanupTests, 7 cleanupTests,
8 createSingleServer, 8 createSingleServer,
@@ -156,6 +156,9 @@ describe('Test external auth plugins', function () {
156 expect(body.account.displayName).to.equal('cyan') 156 expect(body.account.displayName).to.equal('cyan')
157 expect(body.email).to.equal('cyan@example.com') 157 expect(body.email).to.equal('cyan@example.com')
158 expect(body.role.id).to.equal(UserRole.USER) 158 expect(body.role.id).to.equal(UserRole.USER)
159 expect(body.adminFlags).to.equal(UserAdminFlag.NONE)
160 expect(body.videoQuota).to.equal(5242880)
161 expect(body.videoQuotaDaily).to.equal(-1)
159 } 162 }
160 }) 163 })
161 164
@@ -178,6 +181,9 @@ describe('Test external auth plugins', function () {
178 expect(body.account.displayName).to.equal('Kefka Palazzo') 181 expect(body.account.displayName).to.equal('Kefka Palazzo')
179 expect(body.email).to.equal('kefka@example.com') 182 expect(body.email).to.equal('kefka@example.com')
180 expect(body.role.id).to.equal(UserRole.ADMINISTRATOR) 183 expect(body.role.id).to.equal(UserRole.ADMINISTRATOR)
184 expect(body.adminFlags).to.equal(UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST)
185 expect(body.videoQuota).to.equal(42000)
186 expect(body.videoQuotaDaily).to.equal(42100)
181 } 187 }
182 }) 188 })
183 189