mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-31 12:49:57 +00:00
Add a token for stream requests (#8288)
This commit is contained in:
parent
c83c8e5db2
commit
6d2dc73524
@ -13,7 +13,9 @@
|
|||||||
// limitations under the License.
|
// 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'
|
import config from '../config'
|
||||||
|
|
||||||
interface StreamRequest {
|
interface StreamRequest {
|
||||||
@ -28,10 +30,12 @@ export async function requestHLS (ctx: MeasureContext, workspace: string, name:
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
const streamReq: StreamRequest = { format: 'hls', source: name, workspace }
|
const streamReq: StreamRequest = { format: 'hls', source: name, workspace }
|
||||||
|
const token = generateToken(systemAccountUuid)
|
||||||
|
|
||||||
const request = new Request(config.StreamUrl, {
|
const request = new Request(config.StreamUrl, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
|
Authorization: `Bearer ${token}`,
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
body: JSON.stringify(streamReq)
|
body: JSON.stringify(streamReq)
|
||||||
|
Loading…
Reference in New Issue
Block a user