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).
This commit is contained in:
yetone
2026-11-11 01:31:26 +08:00
parent c68b072653
commit 6b11914dfb
2 changed files with 5 additions and 0 deletions
+3
View File
@@ -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`
+2
View File
@@ -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,
}