Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

docs: describe which peer pull routes the sharing gate covers

Adam Eivye6e829fac9b0
diff --git a/docs/PEER_PUSH_AUTH.md b/docs/PEER_PUSH_AUTH.md
index d1e767d23d..c99e03920b 100644
--- a/docs/PEER_PUSH_AUTH.md
+++ b/docs/PEER_PUSH_AUTH.md
@@ -88,7 +88,7 @@ are refused. Brain, memory, catalog and `/api/sync/*` reads also check this
install's sharing settings for the caller (`authorizePeerPull`): a peer whose
category is off is warned about, and refused with `403 PEER_PULL_FORBIDDEN`
when `federation.strictPullAuthorization` is on (the digital twin, MeatSpace
-and character snapshots are always refused). The generic `GET /api/instances/peers/:id/query` proxy reaches only
+and character snapshots refuse a denied caller even without strict mode). The generic `GET /api/instances/peers/:id/query` proxy reaches only
these paths on a paired peer.
`POST /api/instances/peers/pair-secret` is a separate Basic-auth bootstrap, not
diff --git a/server/services/sharing/peerPullAuthorization.js b/server/services/sharing/peerPullAuthorization.js
index 4b1e2c5469..e1abbdf1ad 100644
--- a/server/services/sharing/peerPullAuthorization.js
+++ b/server/services/sharing/peerPullAuthorization.js
@@ -1,9 +1,11 @@
/**
* Receiver-side authorization for peer PULL requests (#3659, #5663).
*
- * Covers BOTH pull transports: the per-record `/api/peer-sync/*` routes
+ * Covers both pull transports, the per-record `/api/peer-sync/*` routes
* (`server/routes/peerSync.js`) and the older snapshot transport
- * `/api/sync/:category/*` (`server/routes/dataSync.js`).
+ * `/api/sync/:category/*` (`server/routes/dataSync.js`), plus the brain,
+ * memory and catalog delta pulls (`routes/brainSync.js`, `memory.js`,
+ * `catalog.js`), which gate on their sync category.
*
* The push direction has always been gated on the user's per-peer sharing
* config (`peerAllowsOutbound` + `peerHasCategory`, see peerSyncPush.js). The
@@ -87,7 +89,8 @@ export function readCallerInstanceId(req) {
* Scope, at most one of:
* - `recordKind` — a per-record `/api/peer-sync/*` read. Gated on
* `peerAllowsOutbound` + `peerHasCategory`, the predicates the push path uses.
- * - `syncCategory` — a whole-category `/api/sync/*` snapshot read. Gated on
+ * - `syncCategory` — a whole-category read: an `/api/sync/*` snapshot or a
+ * brain/memory/catalog delta pull, with its checksum and manifest. Gated on
* `peerAllowsCategoryPull`, which folds the master switch into the resolved
* category map instead of checking it separately, so a default-ON category
* still flows for a peer whose other sync the user turned off.