broker: initialize and start clear the last collection's live rugnux status

/rugnux/status kept answering with the previous collection's rugnux run after POST /initialize,
and also after a /start whose collection does not run rugnux - the latter under the new run's
tokens. RugnuxLiveStatus gets a Clear(), called from JFJochReceiverService::ClearResults(), which
/start already uses to drop the previous run's status, plots and buffered images before the tokens
change. Initialize now calls ClearResults() instead of ClearImageBuffer(), so a fresh start also
drops the previous run's receiver status and plots.

Authentication: every rugnux endpoint (GET/PUT /config/rugnux, PUT/DELETE /config/rugnux/model,
GET /rugnux/status) was already in the broker's bearer-protected set and carries bearerAuth in
jfjoch_api.yaml; the HTTP auth test now checks all five.

The yaml descriptions of /initialize and rugnux_live_status say so; the C++ model and frontend
client are regenerated (comments only).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PXc1zD1yxHqaR1DGdCTHL4
This commit is contained in:
leonarski_fandClaude Opus 5.5 committed 2026-10-20 01:00:54 +02:00
1 parent 48c14b6d1b
commit 02e5bc387f
14 files changed
+58 -15

No files matched your search

+9 -1
View File
@@ -69,7 +69,8 @@ TEST_CASE("JFJochBrokerHttp_BearerTokens", "[broker]") {
for (const char *path: {"/statistics/data_collection", "/result/scan", "/image_buffer/start.cbor",
"/image_buffer/image.cbor?id=0", "/image_buffer/image.tiff?id=0",
"/image_buffer/image.jpeg?id=0", "/preview/plot?type=bkg_estimate",
"/preview/plot.bin?type=bkg_estimate", "/live/events"}) {
"/preview/plot.bin?type=bkg_estimate", "/live/events",
"/config/rugnux", "/rugnux/status"}) {
INFO(path);
auto res = client.Get(path);
REQUIRE(res);
@@ -78,6 +79,11 @@ TEST_CASE("JFJochBrokerHttp_BearerTokens", "[broker]") {
REQUIRE(res->body.find("protected_run") == std::string::npos);
REQUIRE(client.Get(path, wrong)->status == 401);
}
// Live rugnux settings and its model are the dataset's too: changed only with a token.
REQUIRE(client.Put("/config/rugnux", R"({"enable":false})", "application/json")->status == 401);
REQUIRE(client.Put("/config/rugnux/model", "", "application/octet-stream")->status == 401);
REQUIRE(client.Delete("/config/rugnux/model")->status == 401);
REQUIRE(client.Delete("/config/rugnux/model", wrong)->status == 401);
}
SECTION("either token opens them") {
@@ -86,6 +92,8 @@ TEST_CASE("JFJochBrokerHttp_BearerTokens", "[broker]") {
REQUIRE(res->body.find("protected_run") != std::string::npos);
REQUIRE(client.Get("/statistics/data_collection", other)->status == 200);
REQUIRE(client.Get("/preview/plot?type=bkg_estimate", good)->status == 200);
REQUIRE(client.Get("/rugnux/status", good)->status == 200);
REQUIRE(client.Get("/config/rugnux", other)->status == 200);
}
SECTION("the aggregate statistics drop the measurement block instead of refusing") {