pq-secrets: the negative control finds its sibling components in the published layout (pq-kms/, identity/, proof-kinds/, verify-layer/ beside it) as well as in the development tree, and refuses with the list of what is missing when neither is complete; README: compliance and Travel Rule name the verifier they need; conformance README: the online run of 2026-10-18 21:25Z
This commit is contained in:
1 parent
ad16b1f69b
commit
b544cc1b11
4 files changed
+31
-8
No files matched your search
@@ -25,10 +25,26 @@ import { spawn } from 'node:child_process';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const HERE = path.dirname(fileURLToPath(import.meta.url));
|
||||
const RADACINA = path.resolve(HERE, '..', '..', '..'); // aerenew/
|
||||
const S = 'cloud-gateway/pq-secrets/secrete.mjs', SV = 'cloud-gateway/pq-secrets/server.mjs', PR = 'cloud-gateway/pq-secrets/test/proba-secrete.mjs';
|
||||
const IDN = 'tools/aere-identity/identity.mjs', CFM = 'tools/aere-identity/conformitate.mjs', PKS = 'tools/proof-kinds/proof-kinds.mjs';
|
||||
const FISIERE = [S, SV, PR, 'cloud-gateway/pq-kms/kms.mjs', 'cloud-gateway/pq-kms/server.mjs', 'cloud-gateway/pq-kms/hsm-radacina.mjs', IDN, CFM, PKS, 'tools/aere-verify-layer/sidecar.mjs'];
|
||||
// Doua asezari, ca in secrete.mjs: depozitul de dezvoltare (aerenew/cloud-gateway/pq-secrets, tools/aere-identity, tools/proof-kinds,
|
||||
// tools/aere-verify-layer) si forma publicata (pq-secrets/ langa pq-kms/, identity/, proof-kinds/, verify-layer/). Asezarea se alege dupa
|
||||
// ce exista pe disc; daca niciuna nu e intreaga, controlul refuza sa porneasca si spune ce lipseste (nu un ENOENT din mijlocul lui).
|
||||
const ASEZARI = {
|
||||
dezvoltare: { radacina: path.resolve(HERE, '..', '..', '..'), sec: 'cloud-gateway/pq-secrets', kms: 'cloud-gateway/pq-kms', id: 'tools/aere-identity', pk: 'tools/proof-kinds', vl: 'tools/aere-verify-layer' },
|
||||
publicata: { radacina: path.resolve(HERE, '..', '..'), sec: 'pq-secrets', kms: 'pq-kms', id: 'identity', pk: 'proof-kinds', vl: 'verify-layer' },
|
||||
};
|
||||
const fisiereDin = (a) => [`${a.sec}/secrete.mjs`, `${a.sec}/server.mjs`, `${a.sec}/test/proba-secrete.mjs`, `${a.kms}/kms.mjs`, `${a.kms}/server.mjs`,
|
||||
`${a.kms}/hsm-radacina.mjs`, `${a.id}/identity.mjs`, `${a.id}/conformitate.mjs`, `${a.pk}/proof-kinds.mjs`, `${a.vl}/sidecar.mjs`];
|
||||
const intreaga = (a) => fisiereDin(a).every((f) => fs.existsSync(path.join(a.radacina, f)));
|
||||
const ASEZARE_NUME = intreaga(ASEZARI.dezvoltare) ? 'dezvoltare' : intreaga(ASEZARI.publicata) ? 'publicata' : null;
|
||||
if (!ASEZARE_NUME) {
|
||||
for (const [n, a] of Object.entries(ASEZARI)) console.log(`asezarea ${n}: lipsesc ${fisiereDin(a).filter((f) => !fs.existsSync(path.join(a.radacina, f))).join(', ')}`);
|
||||
console.log('NEMASURAT: componentele surori nu sunt nici in forma publicata, nici in depozitul de dezvoltare');
|
||||
process.exit(2);
|
||||
}
|
||||
const ASEZARE = ASEZARI[ASEZARE_NUME];
|
||||
const RADACINA = ASEZARE.radacina;
|
||||
const FISIERE = fisiereDin(ASEZARE);
|
||||
const [S, SV, PR, , , , IDN, CFM, PKS] = FISIERE;
|
||||
const DEV_VERIFY = path.join(RADACINA, 'tools', 'aere-proof-protocol', 'verify.mjs');
|
||||
const VERIFY = process.env.AERE_VERIFY_PROOF ? path.resolve(process.env.AERE_VERIFY_PROOF) : (fs.existsSync(DEV_VERIFY) ? DEV_VERIFY : '');
|
||||
const NICIODATA = "process.env.AERE_SECRETS_PLANTA_NICIODATA === 'da'";
|
||||
@@ -206,7 +222,7 @@ function ruleaza(dest) {
|
||||
const env = { ...envCurat(), AERE_SECRETS_PROBA_JSON: out };
|
||||
if (VERIFY) env.AERE_VERIFY_PROOF = VERIFY; else delete env.AERE_VERIFY_PROOF;
|
||||
return new Promise((gata) => {
|
||||
const c = spawn(process.execPath, [path.join(dest, PR)], { cwd: path.join(dest, 'cloud-gateway', 'pq-secrets'), env, stdio: ['ignore', 'ignore', 'pipe'] });
|
||||
const c = spawn(process.execPath, [path.join(dest, PR)], { cwd: path.join(dest, ASEZARE.sec), env, stdio: ['ignore', 'ignore', 'pipe'] });
|
||||
let stderr = ''; c.stderr.on('data', (d) => { stderr = (stderr + d).slice(-4000); });
|
||||
const ceas = setTimeout(() => c.kill(), 600000);
|
||||
c.on('close', (status, signal) => {
|
||||
@@ -249,6 +265,7 @@ async function main() {
|
||||
if (process.argv.includes('--ancore')) { let rele = 0; for (const p of PL) { const n = fs.readFileSync(path.join(RADACINA, p.fisier), 'utf8').split(p.ancora).length - 1; if (n !== 1) rele++; console.log(`${n === 1 ? 'OK ' : 'RAU '} ${p.id} ancora de ${n} ori in ${p.fisier}`); } return rele ? 1 : 0; }
|
||||
if (new Set(PL.map((p) => p.id)).size !== PL.length) throw new Error('doua plantari cu acelasi id');
|
||||
if (autoproba) console.log('AUTOPROBA: momelile de mai jos TREBUIE sa primeasca verdictul lor de esec\n');
|
||||
console.log(`asezarea: ${ASEZARE_NUME} (${FISIERE.length} fisiere copiate in fiecare copie)`);
|
||||
if (!VERIFY) console.log('verificatorul AIP-23 lipseste (AERE_VERIFY_PROOF): proba plicurilor va fi SARITA in toate rularile\n');
|
||||
const inainte = amprente();
|
||||
const lucru = fs.mkdtempSync(path.join(os.tmpdir(), 'aeresecrets-control-'));
|
||||
|
||||
Reference in new issue
Block a user