From d007dfd7dc17d9b8d05d86b79582b901ac4bfe36 Mon Sep 17 00:00:00 2001 From: atlas Date: Sat, 28 Nov 2026 03:06:33 +0100 Subject: [PATCH] keep the dashboard's probe out of the stub's forge requests The identity-provider stand-in recorded Grafana's datasource-proxy probe with the same forge_token_ok field as a forge request, so the poller's subtest, which takes every record with that field for a forge request, counted three probes and asserted that they carried the forge token. --- nix/vm-tests/k8s-services.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/nix/vm-tests/k8s-services.nix b/nix/vm-tests/k8s-services.nix index 0ef804a65..8d57816a3 100644 --- a/nix/vm-tests/k8s-services.nix +++ b/nix/vm-tests/k8s-services.nix @@ -245,11 +245,22 @@ let def do_GET(self): path = self.path.split("?")[0] + # Grafana's datasource proxy sends a header whose value the test + # checks by digest. The record has no `forge_token_ok`, which the + # poller's subtest reads as the mark of a forge request. + if path == "/legacy-probe": + header = self.headers.get("X-Legacy") + record({ + "host": self.headers.get("Host"), + "path": path, + "legacy_header_sha256": hashlib.sha256(header.encode()).hexdigest() if header else None, + }) + self.send_error(404) + return record({ "host": self.headers.get("Host"), "path": path, "forge_token_ok": self.headers.get("Authorization") == "token ${forgeToken}", - "legacy_header_sha256": hashlib.sha256(self.headers["X-Legacy"].encode()).hexdigest() if self.headers.get("X-Legacy") else None, }) if path.endswith("/repos/search"): self.reply({"ok": True, "data": [{"full_name": "o/r", "has_actions": True, "archived": False, "mirror": False}]})