From fb8cde590ca45bc5617df5d733b0019acf79674e Mon Sep 17 00:00:00 2001 From: gioelecerati Date: Fri, 8 Dec 2023 23:27:58 +0100 Subject: [PATCH 1/3] access-control: better log for admin requests --- packages/api/src/controllers/access-control.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/api/src/controllers/access-control.ts b/packages/api/src/controllers/access-control.ts index 15f4617b18..7c76dcdd2b 100644 --- a/packages/api/src/controllers/access-control.ts +++ b/packages/api/src/controllers/access-control.ts @@ -138,9 +138,14 @@ app.post( if ( playbackPolicyType !== "public" && req.body.pub === req.config.accessControlAdminPubkey && + req.config.accessControlAdminPubkey !== "" && + req.config.accessControlAdminPubkey && req.body.pub !== "" && req.body.pub ) { + console.log( + `access-control: gate: allowing admin access for contentId=${content.id} playbackId=${playbackId}, user=${user.id} is admin, pubKey=${req.config.accessControlAdminPubkey} is adminPubKey` + ); res.status(204); return res.end(); } From 627f7e5d2e4e6dd592953ef0d50fe6334e07064c Mon Sep 17 00:00:00 2001 From: gioelecerati Date: Fri, 8 Dec 2023 23:30:31 +0100 Subject: [PATCH 2/3] dashboard changes --- packages/www/pages/app/stream/[id].tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/www/pages/app/stream/[id].tsx b/packages/www/pages/app/stream/[id].tsx index ec93fd6339..15ca7cc7d7 100644 --- a/packages/www/pages/app/stream/[id].tsx +++ b/packages/www/pages/app/stream/[id].tsx @@ -369,6 +369,12 @@ const ID = () => { broadcasterPlaybackUrl = `https://${lastSession.region}.livepeer.${domain}/stream/${playbackId}.m3u8`; } + let streamAccessToken; + + if (stream && jwt) { + streamAccessToken = jwt; + } + return ( @@ -940,9 +946,7 @@ const ID = () => { JWT for gated stream - - {jwt} - + {streamAccessToken} Region/Broadcaster {region}{" "} From 5d4822bf76b8a1fc65ef547b3de6d3aa41f679cc Mon Sep 17 00:00:00 2001 From: gioelecerati Date: Fri, 8 Dec 2023 23:41:29 +0100 Subject: [PATCH 3/3] fix --- packages/www/pages/app/stream/[id].tsx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/packages/www/pages/app/stream/[id].tsx b/packages/www/pages/app/stream/[id].tsx index 15ca7cc7d7..e958620fc5 100644 --- a/packages/www/pages/app/stream/[id].tsx +++ b/packages/www/pages/app/stream/[id].tsx @@ -369,12 +369,6 @@ const ID = () => { broadcasterPlaybackUrl = `https://${lastSession.region}.livepeer.${domain}/stream/${playbackId}.m3u8`; } - let streamAccessToken; - - if (stream && jwt) { - streamAccessToken = jwt; - } - return ( @@ -946,7 +940,7 @@ const ID = () => { JWT for gated stream - {streamAccessToken} + {jwt} Region/Broadcaster {region}{" "}