This commit is contained in:
legop3
2026-07-10 23:20:09 -04:00
parent ee393adc8e
commit d777e3a48e
27 changed files with 1363 additions and 162 deletions
@@ -10,6 +10,7 @@ const { isAdmin, isLockdownAdmin, getRole } = require('../roleService');
const { isVerified } = require('../verificationService');
const turnService = require('../turnService');
const roverManager = require('../roverManager');
const ptzCameraService = require('../ptzCameraService');
const { getRequestIp, getSocketIp, isLocalNetwork } = require('../../helpers/ipResolver');
const { logAdminEvent } = require('../adminLogService');
@@ -26,6 +27,7 @@ const { canAccessStream } = createVideoAuthPolicy({
isVerified,
turnService,
roverManager,
ptzCameraService,
getSocketIp,
isLocalNetwork,
});
@@ -11,6 +11,7 @@ function createVideoAuthPolicy(deps) {
isVerified,
turnService,
roverManager,
ptzCameraService,
getSocketIp,
isLocalNetwork,
} = deps;
@@ -40,6 +41,10 @@ function createVideoAuthPolicy(deps) {
}
}
if (streamInfo.type === 'ptz') {
return ptzCameraService.canRequestLiveVideo(socket);
}
if (sourceType === 'roverMic' && action === 'publish') {
const roverId = streamInfo.baseId || streamInfo.id;
if (!isVerified(socket)) {
@@ -48,6 +48,10 @@ function extractStreamInfo(path) {
return { type: 'room', id: remaining[1] || '' };
}
if (remaining.length === 2 && remaining[0] === 'ptz') {
return { type: 'ptz', id: remaining[1] || '' };
}
return null;
}