Skip to content

Persist gateway trust across bridge restarts - #189

Merged
Mearman merged 3 commits into
mainfrom
feat/gateway-trust-persistence
Sep 18, 2026
Merged

Mearman merged 3 commits into
mainfrom
feat/gateway-trust-persistence

Conversation

@Mearman

@Mearman Mearman commented Sep 18, 2026

Copy link
Copy Markdown
Member

Closes #186

Persists GatewayTrust's trusted device-id set to a sibling JSON file alongside the existing per-slot identity storage, owner-only permissions, loaded on construction and written on every add/remove. The in-memory Set remains the live source of truth during a process's lifetime; persistence is load-on-start/save-on-mutate only.

Work in progress.

Add loadGatewayTrust/saveGatewayTrust, storing a slot's trusted-gateway
allowlist in its own sibling JSON file alongside the identity file,
owner-only permissions. Unlike loadRoomTokens/saveRoomToken, this has
no dependency on the slot's identity already existing, since the
trusted set carries no key material of its own.
…e slot

Constructing GatewayTrust with an IdentitySlot loads the previously
trusted device-id set from that slot's own storage into the initial
in-memory set, and every add/remove writes the updated set back. The
in-memory Set stays the live source of truth isTrusted/hasAny read at
runtime; persistence is purely load-on-construct, save-on-mutate.
Constructing with no slot keeps the prior in-memory-only behaviour
unchanged, so every existing call site is unaffected until it opts in.
MeshStore's constructor now accepts an optional IdentitySlot, passed
straight to GatewayTrust so its allowlist loads and persists per
bridge slot instead of staying in-memory only. createBridgeMesh and
createBridgeMeshSync now pass their own slot through, so every real
bridge gets restart-surviving gateway trust for free; every other
construction site (tests, test-transport.ts) keeps the prior
in-memory-only behaviour by simply omitting the new parameter.
@Mearman
Mearman marked this pull request as ready for review September 18, 2026 08:06
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 18, 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-18T08:15:59.531634Z f74c4ab Draft marked ready
ℹ️ 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.

@Mearman
Mearman merged commit c41ef73 into main Sep 18, 2026
6 checks passed
@Mearman
Mearman deleted the feat/gateway-trust-persistence branch September 18, 2026 08:08
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 3.15.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Persist gateway trust across bridge restarts

1 participant