Skip to content

feat(core): RevocationCheck implementation and MeshSession revocation-announce plumbing - #66

Merged
Mearman merged 2 commits into
mainfrom
feat/revocation-view
Sep 11, 2026
Merged

feat(core): RevocationCheck implementation and MeshSession revocation-announce plumbing#66
Mearman merged 2 commits into
mainfrom
feat/revocation-view

Conversation

@Mearman

@Mearman Mearman commented Sep 11, 2026

Copy link
Copy Markdown
Member

Closes #59

Two gaps needed together for kick to work end to end:

  1. RevocationCheck (tokens.ts) had no implementation anywhere in the package -- web-console used a hardcoded always-false stub. createRevocationView() returns an in-memory view keyed by (token-id, issuer), fed by verifyRevocationEntry over ingested revocation-announce frames, matching management.cddl's contract that an entry counts only when both token-id and issuer match.

  2. MeshSession.applyFrame handled relay-data, handshake, gossip, relay-inbound, manage-response and manage-request -- a revocation-announce frame arriving on a session was logged into frameLog and otherwise silently ignored, with nothing a consumer could subscribe to. Added revocationAnnouncements (an async iterable beside incomingManageRequests, flattening a frame's entries array to one item per entry) and sendRevocationAnnounce (beside sendManageRequest, sent directly over the connection since this is a gossiped broadcast, not a request addressed to a specific peer).

Extracted bytesToHex out of deviceIdToHex in the same change, since token-id is an arbitrary-length bstr per tokens.cddl rather than a 32-byte device-id, so the revocation view's map key needed a generic byte-string hex encoder.

165 core tests pass (6 new for revocation-view, 2 new for mesh-session's revocation-announce plumbing), Rust conformance suite unaffected (78 passed, no Rust changes -- revocation-announce already had a typed decoder, this only adds TS-side domain logic consuming it).

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-11T21:46:29.615788Z 039665d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

RevocationCheck had no implementation anywhere in the package -- only a
hardcoded always-false stub in web-console. createRevocationView returns
one keyed by (token-id, issuer) per management.cddl's contract: an entry
counts against a token only when both match, so a third party's entry
for someone else's token-id is recorded (it is a well-formed,
self-certifying entry on its own terms) but never matches a lookup for
the token it does not actually govern. record() runs each entry through
verifyRevocationEntry first and drops anything that fails rather than
storing it.

Extracted bytesToHex out of deviceIdToHex since token-id is an
arbitrary-length bstr per tokens.cddl, not a 32-byte device-id, so
keying the view's map needs a generic byte-string hex encoder rather
than a device-id-shaped one.
MeshSession.applyFrame handled relay-data, handshake, gossip,
relay-inbound, manage-response and manage-request -- a revocation-announce
frame arriving on a session was logged into frameLog and otherwise
silently ignored, with no callback or iterator a consumer could subscribe
to. There was consequently no way to either send or receive one through
MeshSession at all.

Added revocationAnnouncements, an async iterable beside
incomingManageRequests, flattening a frame's own entries array to one
item per entry since each is independently verifiable and independently
meaningful regardless of which frame carried it. Added
sendRevocationAnnounce beside sendManageRequest, sent directly over the
connection since revocation-announce is a gossiped broadcast rather than
a request addressed to a specific peer.
@Mearman
Mearman force-pushed the feat/revocation-view branch from 039665d to c12f95e Compare September 11, 2026 21:47
@Mearman
Mearman merged commit 5a7c0ed into main Sep 11, 2026
7 checks passed
@Mearman
Mearman deleted the feat/revocation-view branch September 11, 2026 21:49
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.

MeshSession: revocation-announce ingestion + a RevocationCheck implementation

1 participant