SHA256
Обновить лицензии, исторический HEADER и ссылки CORE/CONTENT
This commit is contained in:
@@ -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))),
|
||||
|
||||
@@ -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))),
|
||||
|
||||
Reference in New Issue
Block a user