decord/alpha/source/modules/rtc/SecureFramesVerifiedStore.tsx

171 lines
5.7 KiB
TypeScript
Raw Normal View History

// Module ID: 10036
// Function ID: 10037
// Name: SecureFramesVerifiedStore
// Dependencies: [502, 4852, 4868, 10037, 10038, 1074, 10054, 4881, 4884, 504, 573, 2]
2026-07-21 06:55:02 +00:00
// Module 10036 (SecureFramesVerifiedStore)
import initializeDefault from "initialize" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 573 */;
import BaseConnectionEvent from "BaseConnectionEvent" /* 4884 */;
import SecureFramesUtils from "SecureFramesUtils" /* 10054 */;
import AuthenticationStore from "AuthenticationStore" /* 502 */;
import RTCConnectionStore from "RTCConnectionStore" /* 4852 */;
import StreamRTCConnectionStore from "StreamRTCConnectionStore" /* 4868 */;
import TransientKeyStore from "TransientKeyStore" /* 10037 */;
import VerifiedKeyStore from "VerifiedKeyStore" /* 10038 */;
2026-07-23 10:11:24 +00:00
require = fn;
2026-07-20 16:05:17 +00:00
function computeCallVerification() {
let userIds = RTCConnectionStore.getUserIds();
2026-07-29 08:29:29 +00:00
if (userIds == null) {
2026-07-20 16:05:17 +00:00
const _Set = Set;
userIds = new Set();
}
let flag = true;
2026-07-29 08:29:29 +00:00
for (const item10020 of userIds) {
if (tmp5 !== item10020) {
if (true !== map.get(tmp6)) {
2026-07-20 16:05:17 +00:00
flag = false;
2026-07-29 08:29:29 +00:00
obj.return();
break;
2026-07-20 16:05:17 +00:00
}
c10 = flag;
return flag !== c10;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
continue;
2026-07-20 16:05:17 +00:00
}
}
function handleUserUpdate(userId) {
userId = userId.userId;
if (AuthenticationStore.getId() === userId) {
2026-07-20 16:05:17 +00:00
return false;
} else {
const secureFramesRosterMapEntry = RTCConnectionStore.getSecureFramesRosterMapEntry(userId);
2026-07-20 16:05:17 +00:00
let flag = false;
if (null != secureFramesRosterMapEntry) {
const _Uint8Array = Uint8Array;
const uint8Array = new Uint8Array(secureFramesRosterMapEntry);
let isKeyVerifiedResult = VerifiedKeyStore.isKeyVerified(userId, uint8Array);
2026-07-20 16:05:17 +00:00
if (!isKeyVerifiedResult) {
isKeyVerifiedResult = TransientKeyStore.isKeyVerified(userId, uint8Array);
2026-07-20 16:05:17 +00:00
}
const items = [RTCConnectionStore, StreamRTCConnectionStore];
2026-07-20 16:05:17 +00:00
if (isKeyVerifiedResult) {
isKeyVerifiedResult = !obj.getIsSecureFramesKeyInconsistent(userId, items);
}
flag = isKeyVerifiedResult !== map.get(userId);
const result = map.set(userId, isKeyVerifiedResult);
obj = SecureFramesUtils;
2026-07-29 08:29:29 +00:00
}
const allActiveStreamKeys = StreamRTCConnectionStore.getAllActiveStreamKeys();
const reduced = allActiveStreamKeys.reduce((acc, item) => {
const tmp = true === map.get(closure_0(dependencyMap[7]).decodeStreamKey(item).ownerId);
value = map1.get(item);
const result = map1.set(item, tmp);
return value !== tmp || acc;
2026-07-29 08:29:29 +00:00
}, false);
2026-07-20 16:05:17 +00:00
if (!flag) {
2026-07-29 08:29:29 +00:00
flag = reduced;
2026-07-20 16:05:17 +00:00
}
if (!flag) {
2026-07-29 08:29:29 +00:00
flag = tmp18;
2026-07-20 16:05:17 +00:00
}
return flag;
}
}
const RTCConnectionStates = fn(1074).RTCConnectionStates;
2026-07-20 16:05:17 +00:00
const map = new Map();
const map1 = new Map();
2026-07-29 08:29:29 +00:00
let c10 = false;
let channelId = null;
2026-08-24 06:08:38 +00:00
const Store = initializeDefault.Store;
2026-07-29 08:29:29 +00:00
class SecureFramesVerifiedStore extends Store {
}
const prototype = SecureFramesVerifiedStore.prototype;
prototype["initialize"] = function initialize() {
this.waitFor(AuthenticationStore, RTCConnectionStore, StreamRTCConnectionStore, TransientKeyStore, VerifiedKeyStore);
2026-07-29 08:29:29 +00:00
};
prototype["isCallVerified"] = function isCallVerified() {
return c10;
};
prototype["isStreamVerified"] = function isStreamVerified(streamKey) {
return map1.get(streamKey);
2026-07-29 08:29:29 +00:00
};
prototype["isUserVerified"] = function isUserVerified(userId) {
return map.get(userId);
2026-07-29 08:29:29 +00:00
};
SecureFramesVerifiedStore.displayName = "SecureFramesVerifiedStore";
const secureFramesVerifiedStore = new SecureFramesVerifiedStore(DispatcherDefault, {
2026-07-29 08:29:29 +00:00
CONNECTION_OPEN: function handleReset() {
map.clear();
map1.clear();
2026-08-24 06:08:38 +00:00
c10 = false;
2026-07-29 08:29:29 +00:00
},
2026-07-20 16:05:17 +00:00
VOICE_CHANNEL_SELECT: function handleVoiceChannelSelect(channelId) {
channelId = channelId.channelId;
2026-07-23 10:11:24 +00:00
if (channelId === channelId) {
2026-07-20 16:05:17 +00:00
return false;
} else {
2026-07-29 08:29:29 +00:00
map.clear();
map1.clear();
2026-08-24 06:08:38 +00:00
c10 = false;
2026-07-20 16:05:17 +00:00
}
},
RTC_CONNECTION_STATE: function handleRtcConnectionState(state) {
({ streamKey, context } = state);
if (state.state !== RTCConnectionStates.DISCONNECTED) {
return false;
2026-07-29 08:29:29 +00:00
} else {
2026-08-24 06:08:38 +00:00
if (BaseConnectionEvent.MediaEngineContextTypes.STREAM === context) {
2026-07-29 08:29:29 +00:00
let tmp6 = null != streamKey;
if (tmp6) {
map1.delete(streamKey);
tmp6 = computeCallVerification();
}
return tmp6;
} else if (tmp10(4884).MediaEngineContextTypes.DEFAULT === context) {
2026-07-29 08:29:29 +00:00
map.clear();
map1.clear();
2026-08-24 06:08:38 +00:00
c10 = false;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp10 = require;
2026-07-20 16:05:17 +00:00
}
},
RTC_CONNECTION_ROSTER_MAP_UPDATE: function handleBulkUserUpdate(userIds) {
userIds = userIds.userIds;
const id = AuthenticationStore.getId();
let reduced = userIds.reduce((acc, userId) => {
let tmp = acc;
if (closure_0 !== userId) {
const obj = { userId };
tmp = handleUserUpdate(obj) || acc;
const tmp3 = handleUserUpdate(obj) || acc;
2026-07-20 16:05:17 +00:00
}
return tmp;
}, false);
const allActiveStreamKeys = StreamRTCConnectionStore.getAllActiveStreamKeys();
const reduced1 = allActiveStreamKeys.reduce((acc, item) => {
const tmp = true === map.get(closure_0(dependencyMap[7]).decodeStreamKey(item).ownerId);
value = map1.get(item);
const result = map1.set(item, tmp);
return value !== tmp || acc;
2026-07-29 08:29:29 +00:00
}, false);
2026-07-20 16:05:17 +00:00
if (!reduced) {
2026-07-29 08:29:29 +00:00
reduced = reduced1;
2026-07-20 16:05:17 +00:00
}
if (!reduced) {
reduced = tmp3;
}
return reduced;
},
SECURE_FRAMES_TRANSIENT_KEY_CREATE: handleUserUpdate,
SECURE_FRAMES_TRANSIENT_KEY_DELETE: handleUserUpdate,
SECURE_FRAMES_VERIFIED_KEY_CREATE: handleUserUpdate,
SECURE_FRAMES_VERIFIED_KEY_DELETE: handleUserUpdate,
SECURE_FRAMES_USER_VERIFIED_KEYS_DELETE: handleUserUpdate
});
const size = fn(2);
let result = size.fileFinishedImporting("modules/rtc/SecureFramesVerifiedStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default secureFramesVerifiedStore;