Remove shareable invitation links
Codes are exchanged by copy and paste again. The URL fragment intake, the invitation dialog, the BroadcastChannel answer relay and the Share link / Copy link controls are gone, along with their tests, browser check scenarios and design doc. Code fields no longer accept links. The compressed HC1 codes with typed offers/answers and echoed refs stay. An optional signaling backend is the intended way to simplify the exchange instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f320bfb541
commit
a5935a8324
16 files changed
+57
-602
No files matched your search
+2
-7
@@ -1,7 +1,7 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { randomBytes } from 'node:crypto';
|
||||
import { CODE_PREFIX, MAX_CODE_LENGTH, MAX_INPUT_LENGTH, codeFromText, codeLink, createRef, decodeCode, encodeCode, type Signal } from '../src/lib/codes.ts';
|
||||
import { CODE_PREFIX, MAX_CODE_LENGTH, MAX_INPUT_LENGTH, createRef, decodeCode, encodeCode, type Signal } from '../src/lib/codes.ts';
|
||||
const fingerprint = Array.from({ length: 32 }, (_, i) => i.toString(16).padStart(2, '0')).join(':');
|
||||
const sdp = `v=0\r\nm=application 9 UDP/DTLS/SCTP webrtc-datachannel\r\na=fingerprint:sha-256 ${fingerprint}\r\n`;
|
||||
const identity = { key: '04' + 'ab'.repeat(64), nonce: 'cd'.repeat(32) };
|
||||
@@ -24,14 +24,9 @@ test('codes round-trip both types, with and without identity', async () => {
|
||||
}
|
||||
});
|
||||
|
||||
test('links, wrapped text and bare codes decode the same', async () => {
|
||||
test('wrapped text and bare codes decode the same', async () => {
|
||||
const code = await encodeCode(offer);
|
||||
const link = codeLink(code, 'https://example.com/apps/hellcon/?x=1#old');
|
||||
assert.equal(link, `https://example.com/apps/hellcon/?x=1#${code}`);
|
||||
assert.equal(codeFromText(link), code);
|
||||
assert.deepEqual(await decodeCode(link), offer);
|
||||
assert.deepEqual(await decodeCode(` ${code.slice(0, 20)}\n${code.slice(20)} `), offer);
|
||||
assert.deepEqual(await decodeCode('#' + code), offer);
|
||||
});
|
||||
|
||||
test('expected type and ref are enforced', async () => {
|
||||
|
||||
Reference in new issue
Block a user