broker: rugnux live settings and model need no bearer token
GET/PUT /config/rugnux and PUT/DELETE /config/rugnux/model prepare the next collection and expose nothing of the current one, so they are open like the rest of the configuration. Protecting them meant the next user needed the previous dataset's token to set up their own run. /rugnux/status, which reports the current collection, stays protected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PXc1zD1yxHqaR1DGdCTHL4
This commit is contained in:
1 parent
456fd5d5cf
commit
147f750c90
5 files changed
+11
-49
No files matched your search
@@ -70,7 +70,7 @@ TEST_CASE("JFJochBrokerHttp_BearerTokens", "[broker]") {
|
||||
"/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",
|
||||
"/config/rugnux", "/rugnux/status"}) {
|
||||
"/rugnux/status"}) {
|
||||
INFO(path);
|
||||
auto res = client.Get(path);
|
||||
REQUIRE(res);
|
||||
@@ -79,11 +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);
|
||||
// Live rugnux settings and its model prepare the next collection: open like the rest of the configuration.
|
||||
REQUIRE(client.Get("/config/rugnux")->status == 200);
|
||||
REQUIRE(client.Put("/config/rugnux", R"({"enable":false})", "application/json")->status == 200);
|
||||
REQUIRE(client.Put("/config/rugnux/model", "", "application/octet-stream")->status == 400);
|
||||
REQUIRE(client.Delete("/config/rugnux/model")->status == 200);
|
||||
}
|
||||
|
||||
SECTION("either token opens them") {
|
||||
@@ -93,7 +93,6 @@ TEST_CASE("JFJochBrokerHttp_BearerTokens", "[broker]") {
|
||||
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") {
|
||||
|
||||
Reference in new issue
Block a user