Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM node:20-bookworm-slim

WORKDIR /app
ENV NODE_ENV=production

COPY package.json package-lock.json ./
RUN npm ci --omit=dev && npm cache clean --force

COPY server.mjs ./

EXPOSE 8080
CMD ["npm", "start"]
15 changes: 0 additions & 15 deletions gen-ed25519.mjs

This file was deleted.

17 changes: 0 additions & 17 deletions tests/smoke.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,6 @@ function extractReceiptEnvelope(body) {
return { receipt, runtimeMetadata };
}

function assertReceiptInvariants(receipt) {
if (!receipt || typeof receipt !== "object") throw new Error("receipt must be object");
const proof = receipt?.metadata?.proof || {};
if (proof.alg !== "ed25519-sha256") throw new Error("proof.alg must be ed25519-sha256");
const canonical = String(proof.canonical_id || proof.canonical || "");
if (canonical !== "json.sorted_keys.v1") throw new Error("canonical must be json.sorted_keys.v1");
if (String(proof.kid || "") !== "v1") throw new Error("kid must be v1");

const h = String(proof.hash_sha256 || "");
if (!/^[a-f0-9]{64}$/i.test(h)) throw new Error("hash_sha256 must be 64 hex chars");

const sigB64 = String(proof.signature_b64 || "");
let sig;
try { sig = Buffer.from(sigB64, "base64"); } catch { sig = null; }
if (!sig || sig.length !== 64) throw new Error("signature_b64 must decode to 64 bytes");
}

function generateTestKeyPair() {
const PRINT_EXPORTS = process.env.PRINT_EXPORTS === "1";

Expand Down
Loading