fix: restore current channel and host admission organs
This commit is contained in:
parent
88ffb1c97a
commit
f46eb1b7c1
54 changed files with 4499 additions and 8 deletions
27
runtime/public-personal-language-os/public-mother-bridge.mjs
Normal file
27
runtime/public-personal-language-os/public-mother-bridge.mjs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import { hash } from './engine.mjs';
|
||||
// Only user-consented application metadata crosses this interface; not the entire private context.
|
||||
export function publicMotherPacket(applicationResponse) {
|
||||
const { application, digest } = applicationResponse;
|
||||
if (!application || typeof digest !== 'string' || !Array.isArray(application.evidenceRefs)) throw Error('APPLICATION_REQUIRED');
|
||||
if (hash(application) !== digest) throw Error('APPLICATION_DIGEST_MISMATCH');
|
||||
return {
|
||||
schema: 'hololake.public-mother-recognition-request/v1', scope: 'public',
|
||||
motherSystem: 'TCS-MOTHER-LPM-0001', publicPersonaBody: 'SYS-GLW-POS-0001',
|
||||
governanceDomain: 'DOMAIN-ZS', applicationDigest: digest,
|
||||
applicationId: application.id, candidateName: application.seedName,
|
||||
evidenceRefs: [...application.evidenceRefs], privateContextIncluded: false,
|
||||
desiredResponse: 'SIGNED_REVIEW_APPLICATION_FROM_ENROLLED_PUBLIC_MOTHER_KEY',
|
||||
automaticFormalRegistration: false,
|
||||
};
|
||||
}
|
||||
|
||||
export async function requestPublicMotherReview(application, transport) {
|
||||
if (typeof transport?.reviewPublic !== 'function') throw Error('PUBLIC_MOTHER_TRANSPORT_NOT_CONNECTED');
|
||||
const packet = publicMotherPacket(application);
|
||||
const response = await transport.reviewPublic(packet);
|
||||
if (response?.action !== 'REVIEW_APPLICATION' || response.payload?.digest !== packet.applicationDigest) {
|
||||
throw Error('MOTHER_REVIEW_NOT_BOUND_TO_APPLICATION');
|
||||
}
|
||||
// The engine still verifies enrolled public role, signature, decision and freshness.
|
||||
return response;
|
||||
}
|
||||
Loading…
Reference in a new issue