Add a token for stream requests (#8288)

This commit is contained in:
Denis Tingaikin 2025-03-20 03:31:37 +03:00 committed by GitHub
parent c83c8e5db2
commit 6d2dc73524
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,7 +13,9 @@
// limitations under the License.
//
import { MeasureContext } from '@hcengineering/core'
import { systemAccountUuid, MeasureContext } from '@hcengineering/core'
import { generateToken } from '@hcengineering/server-token'
import config from '../config'
interface StreamRequest {
@ -28,10 +30,12 @@ export async function requestHLS (ctx: MeasureContext, workspace: string, name:
return
}
const streamReq: StreamRequest = { format: 'hls', source: name, workspace }
const token = generateToken(systemAccountUuid)
const request = new Request(config.StreamUrl, {
method: 'POST',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(streamReq)