feat(chat): add client encryption and key lifecycle

This commit is contained in:
KoalaDev
2026-07-15 07:10:32 +02:00
parent f2eee6dc41
commit ee0d68d8d3
7 changed files with 371 additions and 61 deletions
+11
View File
@@ -0,0 +1,11 @@
export function buildChatRelayPayload(ciphertext) {
return { ciphertext };
}
export function encodeSocketEvent(event, data, forbiddenSecret = '') {
const payload = JSON.stringify([event, data]);
if (forbiddenSecret && payload.includes(forbiddenSecret)) {
throw new Error('Refusing to send chat secret to relay');
}
return `42${payload}`;
}