feat: add endorsement endpoints and deprecate /api/content/verify#1
Merged
Conversation
Explicitly positions this Node.js reference as one of three federated reference directory implementations, each with a distinct curatorial personality: - Node (this) -- permissive community baseline, full-featured, neutral - Python -- curated journalism with admin approval + punitive scoring - Rust -- rapid-flag public-safety with time-decay + researcher whitelist All three conform to the same OpenAPI spec, demonstrating that federation is real: clients subscribe to one or more directories and weight the returned scores per their own trust policy.
Implements spec §2.5 endorsement storage and serving, and aligns the
trust server's role with spec §3.1 by deprecating the server-side
verification endpoint. Cryptographic verification is a local operation
in clients; the trust directory's job is to store and serve signed
artifacts (signatures, endorsements, reports), not to act as an oracle.
Endorsements (spec §2.5):
- POST /api/endorsements stores a signed endorsement blob, optionally
re-verifying server-side as a sanity check (clients MUST NOT rely on
this; verification is local per spec)
- GET /api/endorsements?content-hash=... returns stored blobs verbatim
for clients to verify locally
- DELETE /api/endorsements/:id (MVP-gated; TODO for keyid-match auth)
- Endorsement model with unique compound index on {contentHash, endorser}
Deprecation of /api/content/verify:
- Sets Deprecation: true and Link rel="deprecation" headers on response
- deprecated: true in OpenAPI spec
- README documents the deprecation and points to local verification
Behavior of existing sign and verify endpoints is unchanged; only the
metadata signaling that verify is no longer canonical.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
POST/GET/DELETE /api/endorsements).POST /api/content/verifydeprecated per spec §3.1 — cryptographic verification is a local operation in clients; the trust directory's job is to store and serve signed artifacts, not act as an oracle.Endorsement endpoints
POST /api/endorsements— stores a signed endorsement blob, optionally re-verifying server-side as a sanity check (clients MUST NOT rely on this; verification is local per spec).GET /api/endorsements?content-hash=...— returns stored blobs verbatim for clients to verify locally.DELETE /api/endorsements/:id— MVP-gated on the existing API key; TODO for keyid-match auth.Endorsementmodel with unique compound index on{contentHash, endorser}.Deprecation signaling
Deprecation: trueandLink: <https://htmltrust.dev/spec#section-3-1>; rel="deprecation"headers.deprecated: trueinopenapi.yaml.Test plan
npm installclean, 0 vulnerabilitiesnode src/server.jsboots cleanly with new routes mountedopenapi.yamlparses; new paths/schemas/tag and the deprecated flag verify in the parsed structure🤖 Generated with Claude Code