pq-secrets: a zero-trust secrets service on top of pq-kms (each request authorized by an Aere Identity presentation signed for that exact request, per-secret policy whose non-admin grants can only narrow, the same refusal for every unauthorized caller, every operation a signed AIP-23 secret-access envelope); identity: a presentation optionally signed for one exact request; proof-kinds: secret-access with requestHash; conformance 240 rules, 626 vectors
This commit is contained in:
1 parent
8c7d72c1a7
commit
ad16b1f69b
97 files changed
+4258
-133
No files matched your search
@@ -10,7 +10,8 @@
|
||||
// and its classical impostor (Ed25519), a random envelope nobody notarized, a small dataset
|
||||
// (random salts), the presentations of one identity credential with their forged siblings
|
||||
// (six hybrid key pairs), the SD-JWT and SD-JWT VC tokens, one Travel Rule exchange (with the
|
||||
// beneficiary's KEM key pair, test material declared at the scene) and one compliance exchange,
|
||||
// beneficiary's KEM key pair, test material declared at the scene), one compliance exchange,
|
||||
// the presentations of one credential with and without a request (2026-10-18),
|
||||
// and the transaction of the recorded receipt READ from testnet 28001 (two
|
||||
// eth_ calls; nothing is sent). With --tot everything is made anew; with --refa <name>
|
||||
// ONE source is made anew (its vectors change, the others stay byte for byte)
|
||||
@@ -567,11 +568,26 @@ const PROASPETE_IN_PLUS = {
|
||||
valuesOutsidePolicy: prez(emite({ claims: { ...CL, age_over_18: false, jurisdiction: 'KP', kyc_level: 1, kyc_provider: 'unknown-kyc' }, status: { list: LID, index: 4 } })),
|
||||
otherIssuer: prez(emite({ issuer: alt })), revoked: prez(emite({ status: { list: LID, index: 9 } })) } };
|
||||
},
|
||||
// 2026-10-18 (B8, cloud-gateway/pq-secrets): presentations that commit to the REQUEST the verifier received (OpenID4VP 1.0
|
||||
// transaction_data; the transaction_data_hashes of the SD-JWT VC Key Binding JWT). One holder, two hybrid key pairs made and discarded
|
||||
// here; the request is the digest of a get on a secret in the canonical form of the secrets service (requestHash), the other request
|
||||
// the digest of a revoke of a grant on the same secret; the same holder presents with the request and without it
|
||||
identityRequest: async () => {
|
||||
const T0 = Math.floor(Date.now() / 1000) * 1000 - 3600000, zi = 86400; const at = (s) => new Date(T0 + s * 1000).toISOString(), la = (s) => new Date(T0 + s * 1000);
|
||||
const [iss, hol] = Array.from({ length: 2 }, () => ID.generateKeys());
|
||||
const AUD = 'https://secrets.example', NONCE = 'n-' + crypto.randomBytes(8).toString('hex'), LID = 'https://issuer.example/status/2';
|
||||
const cerere = (operation, body) => sha256(Buffer.from(ID.canonical({ v: 1, kind: 'aere-secrets-request', service: AUD, operation, secret: 'db', body }), 'utf8'));
|
||||
const { credential, disclosures } = ID.issueCredential({ issuer: iss, holder: hol.public, type: 'ServiceAccess', claims: { role: 'deployer', tenant: 'example' }, disclosable: ['role', 'tenant'], validFrom: at(-zi), validUntil: at(365 * zi), status: { list: LID, index: 1 }, now: la(-zi) });
|
||||
const lista = ID.createStatusList({ issuer: iss, id: LID, validFrom: at(-3600), validUntil: at(zi), now: la(-3600) });
|
||||
const prez = (o = {}) => ID.present({ credential, disclosures, reveal: ['role', 'tenant'], presenter: hol, audience: AUD, nonce: NONCE, now: la(0), ...o });
|
||||
const REQUEST = cerere('get', {});
|
||||
return { audience: AUD, nonce: NONCE, now: at(30), trusted: [iss.id], list: lista, request: REQUEST, otherRequest: cerere('revoke', { grantId: 'deployers' }), withRequest: prez({ request: REQUEST }), withoutRequest: prez() };
|
||||
},
|
||||
};
|
||||
|
||||
// ---------- fixed inputs of the AIP-23 kinds (the inputs of the published AIP-23 kind vectors) ----------
|
||||
function intrariKinds() {
|
||||
const AT = '2026-09-26T00:00:00Z'; const H = (s) => sha256(Buffer.from(s, 'utf8'));
|
||||
const AT = '2026-09-26T00:00:00Z'; const H = (s) => sha256(Buffer.from(s, 'utf8')); const DB = 'db-password';
|
||||
return { data: { name: 'report.csv', content: 'a,b,c', createdAt: AT }, execution: { program: 'aere-node', input: 'in', output: 'out', exitCode: 0, createdAt: AT },
|
||||
identity: { subjectId: 'agent-1', publicKey: 'PK', method: 'ml-dsa-65', createdAt: AT }, compliance: { subject: 'org-x', policy: 'pq-ready', result: 'pass', evidence: 'EV', createdAt: AT },
|
||||
runtime: { host: 'h1', artifactContent: 'BIN', attested: H('BIN'), matches: true, createdAt: AT }, location: { subject: 'srv-eu', region: 'eu-central', evidence: 'EV', createdAt: AT },
|
||||
@@ -580,7 +596,9 @@ function intrariKinds() {
|
||||
block: { blockHash: '0x' + 'ab'.repeat(32), stateRoot: '0x' + 'cd'.repeat(32), anchorHeight: 20255488, certificateDigest: '0x' + 'ef'.repeat(32), createdAt: AT },
|
||||
authorization: { grantor: 'org-x', grantee: 'agent-7', scope: 'payments:send<=100', policy: 'POLICY', expiresAt: '2026-12-31T00:00:00Z', createdAt: AT },
|
||||
settlement: { chainId: 2800, txHash: '0x' + '12'.repeat(32), blockHash: '0x' + '34'.repeat(32), from: '0xa', to: '0xb', amount: '100', asset: 'AERE', instruction: 'INSTR', createdAt: AT },
|
||||
provenance: { subject: 'ARTIFACT', parents: ['SRC-1', 'SRC-2'], process: 'BUILD', actor: 'build-bot', createdAt: AT } };
|
||||
provenance: { subject: 'ARTIFACT', parents: ['SRC-1', 'SRC-2'], process: 'BUILD', actor: 'build-bot', createdAt: AT },
|
||||
// 2026-10-18 (B8, cloud-gateway/pq-secrets): the same fixed input as the published kind vector (aere-proof-protocol/genereaza-vectori-kinds.mjs)
|
||||
'secret-access': { service: 'https://secrets.example', secret: DB, version: 2, operation: 'get', verdict: 'allowed', rules: [], grant: 'deployers', holder: 'aere-id:' + '0'.repeat(40), presenter: 'aere-id:' + '1'.repeat(40), presentation: 'BINDING', policy: 'POLICY', createdAt: AT } };
|
||||
}
|
||||
/** Every AIP-23 kind, from its producer, on the fixed inputs. */
|
||||
export function plicuriKinds() {
|
||||
@@ -906,6 +924,18 @@ function construieste() {
|
||||
pl('delegation-credential', 'the link is for another credential', F.linkOtherCredential, ['identity.delegation-credential'], 'the holder gave a link scoped to another credential id');
|
||||
pl('delegation-claims', 'the phone shows a claim outside the scope of its link', F.linkOtherClaims, ['identity.delegation-claims'], 'the holder gave a link for one claim; the phone disclosed two');
|
||||
pl('delegation-audience', 'the link is for another verifier', F.linkOtherAudience, ['identity.delegation-audience'], 'the holder gave a link scoped to another audience'); }
|
||||
// (I2) 2026-10-18 (B8): the presentation commits to the request the verifier received. A verifier that gives the digest of its request
|
||||
// requires exactly that digest in the signed binding; one that gives none leaves it unjudged (PARTIAL), like the audience and the nonce
|
||||
{ const IK = Object.keys(HARTA).filter((r) => r.startsWith('identity.')); const X = P.identityRequest; const A = 'identity-presentation';
|
||||
const intrare = (prez, o = {}) => ({ presentation: prez, audience: X.audience, nonce: X.nonce, now: X.now, trustedIssuers: X.trusted, statusLists: [X.list], request: X.request, ...o });
|
||||
const src = 'producers (identity: issueCredential, createStatusList, present with a request), two hybrid key pairs made and discarded at generation';
|
||||
const AP = { authenticity: 'PASSED' }; const b = 'identity-presentation/request.valid';
|
||||
valid(b, A, 'a holder presents for one request (the digest of a get on a secret); the verifier gives the digest of the request it received, and the signed binding carries it', src, intrare(X.withRequest), { exercises: IK, levels: AP });
|
||||
const fara = { op: 'remove', path: ['request'] };
|
||||
valid('identity-presentation/request.no-request.partial', A, 'the verifier gives no request: what the presentation was signed for is not judged, so it is not VALID', src, aplica(intrare(X.withRequest), fara), { exercises: IK, verdict: 'PARTIAL', levels: { ...AP, integrity: 'NOT_MEASURED' }, base: b, mutation: fara });
|
||||
invalid('identity-presentation/request.other-request', 'the presentation was signed for a get and is handed over for a revoke of a grant (another request digest)', b, { op: 'set', path: ['request'], value: X.otherRequest }, ['identity.request']);
|
||||
invalid('identity-presentation/request.presentation-without-request', 'the same holder presented without a request (the form made before the field existed), to a verifier that requires one', b, null, ['identity.request'],
|
||||
{ producer: { note: 'the holder signed a binding that carries no request', input: intrare(X.withoutRequest), changed: [['presentation']] } }); }
|
||||
// (J) a device bundle (device identity): the manufacturer's credential for the device key, a firmware release, the ownership chain,
|
||||
// the owner's authorization, the device's fresh attestation, judged with what the verifier brings (clock, nonce, audience, trusted
|
||||
// manufacturers, the recall list, the firmware policy, the status records, its reading of the notarized envelope)
|
||||
|
||||
Reference in new issue
Block a user