From 6b11914dfb2cc3be5c9745300f1b5f67fe2583b2 Mon Sep 17 00:00:00 2001 From: yetone Date: Wed, 11 Nov 2026 01:31:26 +0800 Subject: [PATCH] gateway: name magpie's CA route for the one-port page and read-only keys 4623f5419 registered GET /magpie-ca.crt without classifying it, so TestClientPathCoversHandler and TestReadOnlyKeyEveryRoute have been red on ubuntu and macOS CI since (runs 42842906906, 42857020211). The CA is answered without a key (caFileOpen), so a read-only key may read it too, as it may the key and join pages; and `magpie web`'s port hands it to the gateway like those pages, so the other computer fetches it from the address it gives its agents. Run (wsl-run, magpie-desktop, -tags nogui, at this tree): go test -count=1 -run 'TestClientPath|TestReadOnlyKey|TestBrowserKey| TestHTTPS|TestKeyPage|TestJoin|TestOnePort' ./internal/gateway: ok. Red before: the two guards on CI at db0f2f20d and 5b28e8599. Not run: the whole gateway package (running after the push). --- internal/gateway/oneport.go | 3 +++ internal/gateway/readonly.go | 2 ++ 2 files changed, 5 insertions(+) diff --git a/internal/gateway/oneport.go b/internal/gateway/oneport.go index aeec60a14..24487b27e 100644 --- a/internal/gateway/oneport.go +++ b/internal/gateway/oneport.go @@ -33,6 +33,9 @@ var clientPrefixes = []string{ KeyPagePath, // and the join page (JoinPagePath), at the same address JoinPagePath, + // and magpie's CA (CAPath), which the other computer fetches from the + // address it gives its agents + CAPath, } // ClientPath: p is one of the gateway's client routes, which `magpie web` diff --git a/internal/gateway/readonly.go b/internal/gateway/readonly.go index a1aed7af3..47f4126b2 100644 --- a/internal/gateway/readonly.go +++ b/internal/gateway/readonly.go @@ -47,6 +47,8 @@ var readOnlyRoutes = map[string]bool{ "GET " + JoinPagePath: true, "GET " + joinData: true, "POST " + joinData: true, + // magpie's CA, answered without a key (https.go caFileOpen) + "GET " + CAPath: true, // a proof carries no key, and answers none (remote_prove.go) "POST " + provider.RemoteProvePath: true, }