Skip to content

Commit 680c582

Browse files
authored
Update server.mjs
1 parent 6942c51 commit 680c582

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

server.mjs

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,12 +1396,9 @@ return res.json(receipt);
13961396
}
13971397

13981398
return res.status(500).json(receipt);
1399-
<<<<<<< HEAD
14001399
eed1802 (Runtime: signer env standardization + ENS verify smoke)
14011400

14021401
}
1403-
=======
1404-
>>>>>>> 37238de (Fix verify route structure and restore compile integrity)
14051402
}
14061403

14071404
// -----------------------
@@ -1583,30 +1580,25 @@ app.post("/debug/prewarm", requireDebug, (req, res) => {
15831580
// verify endpoint (signature/hash + optional schema + optional ENS binding)
15841581
// -----------------------
15851582
app.post("/verify", async (req, res) => {
1586-
<<<<<<< HEAD
15871583
const receipt = req.body;
1588-
=======
1584+
15891585
const work = async () => {
15901586
const receipt = req.body;
1591-
>>>>>>> 37238de (Fix verify route structure and restore compile integrity)
15921587

15931588
const wantEns = String(req.query.ens || "0") === "1";
15941589
const strictKid = String(req.query.strict_kid || "0") === "1";
15951590
const refresh = String(req.query.refresh || "0") === "1";
15961591
const wantSchema = String(req.query.schema || "0") === "1";
15971592

1598-
<<<<<<< HEAD
15991593
const proof = receipt?.metadata?.proof;
16001594
const proofCanonical = String(proof?.canonical_id || proof?.canonical || "");
16011595
const runtimeCoreReceipt = normalizeReceiptForRuntimeCoreVerify(receipt);
16021596

16031597
const verifyLogic = async () => {
1604-
=======
16051598
const proof = receipt?.metadata?.proof;
16061599
const proofCanonical = String(proof?.canonical_id || proof?.canonical || "");
16071600
const runtimeCoreReceipt = normalizeReceiptForRuntimeCoreVerify(receipt);
16081601

1609-
>>>>>>> 37238de (Fix verify route structure and restore compile integrity)
16101602
if (!proof?.signature_b64 || !proof?.hash_sha256) {
16111603
return res.status(400).json({
16121604
ok: false,
@@ -1655,18 +1647,16 @@ app.post("/verify", async (req, res) => {
16551647
canonical: ensOut.canonical || null,
16561648
};
16571649

1658-
<<<<<<< HEAD
16591650
const kidOk = strictKid && ensExpect.kid ? String(proof.kid || "") === ensExpect.kid : true;
16601651
const canonicalOk = proofCanonical === String(ensExpect.canonical || "");
16611652
const signerOk = String(proof.signer_id || "") === String(ensExpect.signer_ens || "");
1662-
=======
1653+
16631654
// Enforce kid/canonical/signer binding from ENS BEFORE cryptographic verify
16641655
const kidOk =
16651656
strictKid && ensExpect.kid ? String(proof.kid || "") === ensExpect.kid : true;
16661657

16671658
const canonicalOk = proofCanonical === (ensExpect.canonical || "");
16681659
const signerOk = String(proof.signer_id || "") === (ensExpect.signer_ens || "");
1669-
>>>>>>> 37238de (Fix verify route structure and restore compile integrity)
16701660

16711661
if (!kidOk || !canonicalOk || !signerOk) {
16721662
return res.status(400).json({
@@ -1795,15 +1785,13 @@ app.post("/verify", async (req, res) => {
17951785
}
17961786
}
17971787

1798-
<<<<<<< HEAD
17991788
const okFinal = hashMatches === true && signatureValid === true && (wantSchema ? schemaOk === true : true);
1800-
=======
1789+
18011790
// ok requires proven hash+sig; schema only required if requested
18021791
const okFinal =
18031792
hashMatches === true &&
18041793
signatureValid === true &&
18051794
(wantSchema ? schemaOk === true : true);
1806-
>>>>>>> 37238de (Fix verify route structure and restore compile integrity)
18071795

18081796
return res.json({
18091797
ok: okFinal,
@@ -1833,11 +1821,9 @@ app.post("/verify", async (req, res) => {
18331821

18341822
try {
18351823
await Promise.race([
1836-
<<<<<<< HEAD
18371824
verifyLogic(),
1838-
=======
1825+
18391826
work(),
1840-
>>>>>>> 37238de (Fix verify route structure and restore compile integrity)
18411827
new Promise((_, rej) => setTimeout(() => rej(new Error("verify_timeout")), VERIFY_MAX_MS)),
18421828
]);
18431829
} catch (e) {
@@ -1865,4 +1851,4 @@ initializeSignerConfigOrThrow();
18651851
app.listen(PORT, HOST, () => {
18661852
console.log(`runtime listening on http://${HOST}:${PORT}`);
18671853
});
1868-
}); // <-- closes app.post("/verify", ... )
1854+
}); // <-- closes app.post("/verify", ... )

0 commit comments

Comments
 (0)