refactor(core): drop per-terminal device labels
Remove sealLabel/openLabel and their label constants; devices are no longer named per channel. Rename the create setting seats to max_members and point the e2e join helper at POST /join.
This commit is contained in:
1 parent
d946fc5e8a
commit
5fd4ddd411
6 files changed
+12
-171
No files matched your search
@@ -182,30 +182,6 @@ describe('raw 帧', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('设备名', () => {
|
||||
it('固定 IV 下的密文一致,并能解回', async () => {
|
||||
const session = await openVectorSession();
|
||||
for (const l of vectors.labels) {
|
||||
const sealed = await session.sealLabel(l.name, { iv: h(l.iv) });
|
||||
expect(toHex(sealed)).toBe(l.blob);
|
||||
expect(sealed.length).toBeLessThanOrEqual(256);
|
||||
expect(await session.openLabel(sealed, session.endpointHash)).toBe(l.name);
|
||||
}
|
||||
});
|
||||
|
||||
it('换一个终端的哈希就解不开(AAD 绑定终端)', async () => {
|
||||
const session = await openVectorSession();
|
||||
const sealed = await session.sealLabel('我的 iPhone');
|
||||
await expect(session.openLabel(sealed, new Uint8Array(32))).rejects.toThrowError(IntegrityError);
|
||||
});
|
||||
|
||||
it('超过 228 字节 UTF-8 时拒绝', async () => {
|
||||
const session = await openVectorSession();
|
||||
await expect(session.sealLabel('x'.repeat(229))).rejects.toThrow();
|
||||
await expect(session.sealLabel('x'.repeat(228))).resolves.toHaveLength(256);
|
||||
});
|
||||
});
|
||||
|
||||
describe('链接', () => {
|
||||
it('合法链接解析结果与向量一致', () => {
|
||||
for (const v of vectors.links.valid) {
|
||||
|
||||
Reference in new issue
Block a user