Repository navigation
feat(be): open the TEE Explorer report already verified, no pasting (#277) - #279
Conversation
POST /v1/runs/{runId}/proof/tee-explorer uploads the Intel quote(s) in the
run's stored proof to Phala's TEE Attestation Explorer through its own
POST /api/upload and answers the report links. The Explorer has no prefill
URL and no CORS, so the FE couldn't do it, and pasting "Copy the proof"
answered "The quote is invalid". One upload per quote; owner only; an
Explorer failure answers 503.
Tests: bun run test 134/134 (fake Explorer: the quote's bytes uploaded once,
second click reused, other user 404, no proof 404, Explorer down 503);
bun run load: 0 errors, 0 runs missing events; one real upload from a local
run returned verified: true and the report link the owner checked by hand.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q5ZrzK8une3S2YyhDG746e
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q5ZrzK8une3S2YyhDG746e
|
Merged with Axel's approval; Checked in Chrome before the merge, on a local stack with the real Explorer:
@AncungAulia the route is live after this deploy. The FE part of #277 is yours:
@Lin1er no env change needed on the box; |
|
@Lexirieru read the backend diff; looks good to me. Same route and shape as my Checked by reading the diff (tests not re-run by me; CI
Small nits, none blocking:
Also: #278 ( |
|
Live on the hosted demo:
|
Backend part of #277. "Paste the quote in TEE Explorer" can open a report that already reads VERIFIED, so nobody pastes anything.
Why
POST /api/upload, multipartfile= the quote's bytes, then opens/reports/<checksum>. That API sends no CORS headers, so the FE can't call it.What
POST /v1/runs/{runId}/proof/tee-explorer, owner only:{ runId, reports: [{ attestation, kind, url, verified }] }.apps/be/src/teeExplorer.ts:TEE_EXPLORER_URL(defaulthttps://proof.t16z.com).404 no_proof;503 tee_explorer_unreachable/tee_explorer_error(never 502, per apps/be/CLAUDE.md);422 not_a_quote.apps/be/CLAUDE.md,apps/be/.env.example,docs/api-contract.md.Tests (local)
bun run typecheck: passes.bun run test: 134/134 (1 opt-in AgentMail live test skipped). New tests againsttest/fake-explorer.ts:no_proof, GET gets 405;tee_explorer_error.bun run load: 0 errors, 1525 runs stored, 0 missing events, approvals and Telegram checks all clean.verified: trueandhttps://proof.t16z.com/reports/1b374e5b…, the report Axel opened by hand: VERIFIED, nonce…99e266, compose hash matching our proof.For @AncungAulia (FE,
View proofdialog)const w = window.open('', '_blank').POST /v1/runs/{runId}/proof/tee-explorerand setw.location = reports[0].url. If it fails,w.close()and fall back to today's link with "Copy the Intel quote".🤖 Generated with Claude Code
https://claude.ai/code/session_01Q5ZrzK8une3S2YyhDG746e