function runSuite () {
- async function checkPrivateWebTorrentFiles (uuid: string) {
+ async function checkPrivateFiles (uuid: string) {
const video = await server.videos.getWithToken({ id: uuid })
for (const file of video.files) {
}
}
- async function checkPublicWebTorrentFiles (uuid: string) {
+ async function checkPublicFiles (uuid: string) {
const video = await server.videos.get({ id: uuid })
for (const file of getAllFiles(video)) {
const { uuid } = await server.videos.quickUpload({ name: 'video', privacy })
await waitJobs([ server ])
- await checkPrivateWebTorrentFiles(uuid)
+ await checkPrivateFiles(uuid)
}
})
await server.videos.update({ id: uuid, attributes: { privacy } })
await waitJobs([ server ])
- await checkPrivateWebTorrentFiles(uuid)
+ await checkPrivateFiles(uuid)
}
})
await server.videos.update({ id: uuid, attributes: { privacy: VideoPrivacy.UNLISTED } })
await waitJobs([ server ])
- await checkPublicWebTorrentFiles(uuid)
+ await checkPublicFiles(uuid)
})
it('Should upload an internal video and update it to public to have a public static path', async function () {
await server.videos.update({ id: uuid, attributes: { privacy: VideoPrivacy.PUBLIC } })
await waitJobs([ server ])
- await checkPublicWebTorrentFiles(uuid)
+ await checkPublicFiles(uuid)
})
it('Should upload an internal video and schedule a public publish', async function () {
await waitJobs([ server ])
- await checkPublicWebTorrentFiles(uuid)
+ await checkPublicFiles(uuid)
})
}
})
})
+ describe('With static file right check disabled', function () {
+ let videoUUID: string
+
+ before(async function () {
+ this.timeout(240000)
+
+ await server.kill()
+
+ await server.run({
+ static_files: {
+ private_files_require_auth: false
+ }
+ })
+
+ const { uuid } = await server.videos.quickUpload({ name: 'video', privacy: VideoPrivacy.INTERNAL })
+ videoUUID = uuid
+
+ await waitJobs([ server ])
+ })
+
+ it('Should not check auth for private static files', async function () {
+ const video = await server.videos.getWithToken({ id: videoUUID })
+
+ for (const file of getAllFiles(video)) {
+ await makeRawRequest({ url: file.fileUrl, expectedStatus: HttpStatusCode.OK_200 })
+ }
+
+ const hls = video.streamingPlaylists[0]
+ await makeRawRequest({ url: hls.playlistUrl, expectedStatus: HttpStatusCode.OK_200 })
+ await makeRawRequest({ url: hls.segmentsSha256Url, expectedStatus: HttpStatusCode.OK_200 })
+ })
+ })
+
after(async function () {
await cleanupTests([ server ])
})