]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/fixtures/peertube-plugin-test-id-pass-auth-three/main.js
Merge branch 'release/5.1.0' into develop
[github/Chocobozzz/PeerTube.git] / server / tests / fixtures / peertube-plugin-test-id-pass-auth-three / main.js
index 372f3fa0c1c0f11aa06baa2edd077df824a46065..1200acfbd27c2a98f120ddc59c0c1056647a9e3e 100644 (file)
@@ -23,6 +23,75 @@ async function register ({
       return null
     }
   })
+
+  registerIdAndPassAuth({
+    authName: 'ward-auth',
+
+    getWeight: () => 5,
+
+    login (body) {
+      if (body.id === 'ward') {
+        return Promise.resolve({
+          username: '-ward-42',
+          email: 'ward@example.com'
+        })
+      }
+
+      return null
+    }
+  })
+
+  registerIdAndPassAuth({
+    authName: 'kiros-auth',
+
+    getWeight: () => 5,
+
+    login (body) {
+      if (body.id === 'kiros') {
+        return Promise.resolve({
+          username: 'kiros',
+          email: 'kiros@example.com',
+          displayName: 'a'.repeat(5000)
+        })
+      }
+
+      return null
+    }
+  })
+
+  registerIdAndPassAuth({
+    authName: 'raine-auth',
+
+    getWeight: () => 5,
+
+    login (body) {
+      if (body.id === 'raine') {
+        return Promise.resolve({
+          username: 'raine',
+          email: 'raine@example.com',
+          role: 42
+        })
+      }
+
+      return null
+    }
+  })
+
+  registerIdAndPassAuth({
+    authName: 'ellone-auth',
+
+    getWeight: () => 5,
+
+    login (body) {
+      if (body.id === 'ellone') {
+        return Promise.resolve({
+          username: 'ellone'
+        })
+      }
+
+      return null
+    }
+  })
 }
 
 async function unregister () {