Обновить лицензии, исторический HEADER и ссылки CORE/CONTENT

This commit is contained in:
AidarKC
2026-12-05 23:45:02 +03:00
parent 37a04dde4d
commit 6968d11693
28 changed files with 313 additions and 126 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ const source = auth.split('function makeHeaderBodyBytes(')[1]?.split('\nfunction
assert.ok(source, 'production makeHeaderBodyBytes must exist');
const utf8 = value => new TextEncoder().encode(value);
const encode = vm.runInNewContext(`function makeHeaderBodyBytes(${source}\nmakeHeaderBodyBytes`, {
HEADER_DEFAULT_LICENSE: auth.match(/export const HEADER_DEFAULT_LICENSE = '([^']+)'/)[1],
HEADER_DEFAULT_LICENSE: JSON.parse(auth.match(/export const HEADER_DEFAULT_LICENSE = ("[^"]+");/)[1]),
utf8Bytes: utf8,
int8Byte: value => Uint8Array.of(value),
concatBytes: (...parts) => Uint8Array.from(parts.flatMap(part => Array.from(part))),
+1 -1
View File
@@ -39,7 +39,7 @@ test('existing body factories produce exact independent signed pair; ordinal is
assert.equal(inspection.frame.blockNumber,core.blockNumber);assert.equal(inspection.frame.type,content.type);
assert.deepEqual(Buffer.from(inspection.frame.bodyBytes),Buffer.from(content.body));
if(core.line) assert.equal(inspection.frame.body.line.lineSequence,42);
if(core.blockNumber===0) assert.match(inspection.frame.body.license,/^licenses:CC-BY-NC-4\.0\/sha256:/);
if(core.blockNumber===0) assert.match(inspection.frame.body.license,/^public-content-license-grant:.*Licenses:CC-BY-NC-4\.0\/sha256:.*;SHiNE-CDL-1\.0\/sha256:/);
}
});
test('lost response: retransmit the identical signed container, then confirm canonical bytes',async()=>{
@@ -10,7 +10,7 @@ const auth = read('../js/services/auth-service.js');
const makeBytesFunction = auth.split('function makeHeaderBodyBytes(')[1]?.split('\nfunction makeUserParamBodyBytes(')[0];
assert.ok(makeBytesFunction);
const context = {
HEADER_DEFAULT_LICENSE: auth.match(/export const HEADER_DEFAULT_LICENSE = '([^']+)'/)[1],
HEADER_DEFAULT_LICENSE: JSON.parse(auth.match(/export const HEADER_DEFAULT_LICENSE = ("[^"]+");/)[1]),
utf8Bytes: value => new TextEncoder().encode(value),
int8Byte: value => Uint8Array.of(value),
concatBytes: (...parts) => Uint8Array.from(parts.flatMap(part => Array.from(part))),