#176 Peer relationship management: edit allow-lists in place + per-peer disable (v0.6.20) #231

Merged
Cordy merged 2 commits from feat/176-peer-mgmt into main 2026-08-14 01:17:02 +00:00
Owner

Greenlit backend for the #150 relationship card.

Registry

  • Peer.Disabled bool (json:"disabled,omitempty" — absent = enabled, so existing peers.json stays enabled across the upgrade).
  • UpdatePeer(name, apply func(*Peer)) — in-place mutation of the four allow-lists / the Disabled flag, key + URL untouched.
  • IsDisabled(peer); CanSend/CanReceive return false for a disabled peer.

Wire enforcement (fail-closed, both planes)

  • Authenticate refuses a disabled peer with a valid key exactly like an unknown one; PrepareTransfer/CompleteTransfer refuse immediately (no waiting for the session TTL).

API

  • PATCH /api/v1/admin/peering/peers/{name} (admin-gated): partial update — a present list replaces, an absent one is unchanged; enabled toggles. listPeers now emits enabled.

Tests: registry (replace + disable + re-enable + unknown→404), service (disabled peer denied at auth + mid-session), api (PATCH replace/disable/list/404).

Backend only; the relationship-card UI (#150) consumes this next.

Greenlit backend for the #150 relationship card. **Registry** - `Peer.Disabled bool` (`json:"disabled,omitempty"` — absent = enabled, so existing `peers.json` stays enabled across the upgrade). - `UpdatePeer(name, apply func(*Peer))` — in-place mutation of the four allow-lists / the Disabled flag, key + URL untouched. - `IsDisabled(peer)`; `CanSend`/`CanReceive` return false for a disabled peer. **Wire enforcement (fail-closed, both planes)** - `Authenticate` refuses a disabled peer with a valid key exactly like an unknown one; `PrepareTransfer`/`CompleteTransfer` refuse immediately (no waiting for the session TTL). **API** - `PATCH /api/v1/admin/peering/peers/{name}` (admin-gated): partial update — a present list replaces, an absent one is unchanged; `enabled` toggles. `listPeers` now emits `enabled`. **Tests:** registry (replace + disable + re-enable + unknown→404), service (disabled peer denied at auth + mid-session), api (PATCH replace/disable/list/404). Backend only; the relationship-card UI (#150) consumes this next.
Cordy merged commit 2ac9b8dc7c into main 2026-08-14 01:17:02 +00:00
Cordy deleted branch feat/176-peer-mgmt 2026-08-14 01:17:05 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#231
No description provided.