From 5a122dddc5aab1b2ae1843411032d5f392bdd216 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 26 Oct 2022 16:23:39 +0200 Subject: Option to disable static files auth check/s3 proxy --- .../tests/api/videos/video-static-file-privacy.ts | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'server/tests/api/videos/video-static-file-privacy.ts') diff --git a/server/tests/api/videos/video-static-file-privacy.ts b/server/tests/api/videos/video-static-file-privacy.ts index bdbe85127..eaaed5aad 100644 --- a/server/tests/api/videos/video-static-file-privacy.ts +++ b/server/tests/api/videos/video-static-file-privacy.ts @@ -383,6 +383,39 @@ describe('Test video static file privacy', function () { }) }) + 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 ]) }) -- cgit v1.2.3