Peering panel: per-peer "Test" button — run the control-plane handshake without sending data #142

Closed
opened 2026-08-09 01:01:03 +00:00 by Cordy · 1 comment
Owner

From the #106 dogfood: registering a peer with a wrong URL/scheme surfaces only at the first real send, in the worst place (a failed transfer in the user's Transfers view). Two live examples within one hour: an https:// URL dialing a plain-HTTP peer, and the portless-URL→443 gRPC default (#140). Both would have been caught at registration time by a connectivity test.

Design: a Test button on each row of "Instances you can send to" (and offered right after registering).

  • Server: POST /api/v1/admin/peering/peers/{name}/test (admin-gated like the other peering admin routes). Runs Hello + Authenticate against the peer using the stored URL and key — the real client code path incl. grpcTarget — with a short timeout (~5s). No transfer is prepared; nothing is written on either side.
  • Response: { ok: true } or { ok: false, error: "<the actual gRPC/transport error>" } — the raw error is the value; it is exactly what the admin needs to distinguish "wrong URL", "wrong key", "peering disabled on the far side" (503), and "TLS/h2 mismatch".
  • UI: button per peer row; result inline in the row (small ✓ / ✗ + message), not in the global dialog message line.
  • i18n en/de/fr/it.

Honest scope note: this validates URL + key + transport. It deliberately does NOT validate the sender/receiver allowlists (a local-config concern the panel already shows per row since #129) and does not prove the data plane (that needs a transfer). Name the button "Test connection" so it doesn't overpromise.

From the #106 dogfood: registering a peer with a wrong URL/scheme surfaces only at the first real send, in the worst place (a failed transfer in the user's Transfers view). Two live examples within one hour: an `https://` URL dialing a plain-HTTP peer, and the portless-URL→443 gRPC default (#140). Both would have been caught at registration time by a connectivity test. **Design:** a **Test** button on each row of "Instances you can send to" (and offered right after registering). - Server: `POST /api/v1/admin/peering/peers/{name}/test` (admin-gated like the other peering admin routes). Runs `Hello` + `Authenticate` against the peer using the stored URL and key — the real client code path incl. `grpcTarget` — with a short timeout (~5s). No transfer is prepared; nothing is written on either side. - Response: `{ ok: true }` or `{ ok: false, error: "<the actual gRPC/transport error>" }` — the raw error is the value; it is exactly what the admin needs to distinguish "wrong URL", "wrong key", "peering disabled on the far side" (503), and "TLS/h2 mismatch". - UI: button per peer row; result inline in the row (small ✓ / ✗ + message), not in the global dialog message line. - i18n en/de/fr/it. **Honest scope note:** this validates URL + key + transport. It deliberately does NOT validate the sender/receiver allowlists (a local-config concern the panel already shows per row since #129) and does not prove the data plane (that needs a transfer). Name the button "Test connection" so it doesn't overpromise.
Author
Owner

Shipped in v0.4.12 (PR #149), live on the dogfood. As specced: "Test connection" button per peer row → admin POST /api/v1/admin/peering/peers/{name}/test → new Client.Ping runs Hello + Authenticate through the REAL client path (grpcTarget dial derivation included), 5s timeout, no transfer prepared, nothing written on either side. Response is {ok:true} or {ok:false, error:"<raw gRPC/transport error>"} — the raw error is deliberately the payload, since it distinguishes wrong URL / wrong key / peering-disabled-503 / h2 mismatch at a glance. Result renders inline in the row (✓ green / ✗ red + message), not in the dialog's global message line. Both test invocations audited. Would have caught #140 and #143 at registration time — which is why it exists.

Shipped in **v0.4.12** (PR #149), live on the dogfood. As specced: **"Test connection"** button per peer row → admin `POST /api/v1/admin/peering/peers/{name}/test` → new `Client.Ping` runs Hello + Authenticate through the REAL client path (`grpcTarget` dial derivation included), 5s timeout, no transfer prepared, nothing written on either side. Response is `{ok:true}` or `{ok:false, error:"<raw gRPC/transport error>"}` — the raw error is deliberately the payload, since it distinguishes wrong URL / wrong key / peering-disabled-503 / h2 mismatch at a glance. Result renders inline in the row (✓ green / ✗ red + message), not in the dialog's global message line. Both test invocations audited. Would have caught #140 and #143 at registration time — which is why it exists.
Cordy closed this issue 2026-08-09 02:55:32 +00:00
Sign in to join this conversation.
No labels
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#142
No description provided.