Skip to content

feat: update verify page for HTML and PDF uploads (#37) - #43

Merged
gkanitz merged 1 commit into
mainfrom
feat/issue-37-verify-page-html-pdf
Jun 22, 2026
Merged

feat: update verify page for HTML and PDF uploads (#37)#43
gkanitz merged 1 commit into
mainfrom
feat/issue-37-verify-page-html-pdf

Conversation

@gkanitz

@gkanitz gkanitz commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace JSON-only upload path with report.html and report.pdf support; .json drops with a clear error message
  • verifyHTML: hashes full bytes, extracts verification.repository from embedded <script type="application/json" id="coderepute-report"> tag, runs existing attestation/Rekor pipeline
  • verifyPDF: hashes full bytes, resolves repo from URL ?repo= hint → XMP packet regex (<?xpacket markers, <meta name="coderepute:repo">) → {status:"needs-repo"} UI prompt; no PDF library added
  • verifyFile: top-level dispatcher by file name/MIME type
  • prefillFromURL(): reads ?repo= and ?subject= on page load so QR code scans land on a ready-to-use page
  • index.html: updated accept=".html,.pdf", drop-zone copy, needs-repo prompt section, removed paste/JSON textarea

Test plan

  • npm test in docs/verify/ passes — 64 tests across 18 suites (18 new tests added)
  • All 46 pre-existing tests continue to pass unchanged
  • verifyHTML fixture: minimal HTML with embedded JSON in testdata/report.html
  • verifyPDF fixture: minimal PDF with XMP packet in testdata/report.pdf
  • .json file dispatch rejects with message referencing report.html or report.pdf
  • prefillFromURL is a no-op in Node (no document)
  • No new npm dependencies added

🤖 Generated with Claude Code

Replace JSON-only verification with support for report.html (extracts
embedded JSON from <script id="coderepute-report"> tag) and report.pdf
(reads repo from URL ?repo= param or XMP metadata packet). Drops .json
upload path with a clear error. Adds prefillFromURL() for QR code
scan landing. 18 test suites, 64 tests, all pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gkanitz
gkanitz merged commit 0b74bd1 into main Jun 22, 2026
1 check passed
@gkanitz
gkanitz deleted the feat/issue-37-verify-page-html-pdf branch June 22, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant