gh#204: the HTTP listener serves the bridge to authenticated clients only

Tests › tests/unit/api/http_listener_test.cpp

absent Not in the packaged run: no test report names it.

What this test is for

Why it exists

The test says nothing about why.

tests/unit/api/http_listener_test.cpp:170 · its file's page

What it checks (28)

  1. REQUIRE(listener.start(err)) observes start
  2. REQUIRE(port > 0) observes port via port
  3. CHECK(listener.token_file() == entropic::http::token_path_for(port)) observes token_file
  4. CHECK(token.size() == 64) observes slurp via token
  5. REQUIRE(r) observes rpc via r
  6. CHECK(r->status == 401) observes rpc via r
  7. REQUIRE(r) observes auth via r
  8. CHECK(r->status == 401) observes auth via r
  9. REQUIRE(r) observes rpc via r
  10. CHECK(r->status == 403) observes rpc via r
  11. REQUIRE(r) observes rpc via r
  12. CHECK(r->status == 403) observes rpc via r
  13. REQUIRE(r) observes auth via r
  14. REQUIRE(r->status == 200) observes auth via r
  15. CHECK(has_ask) not attributed
  16. REQUIRE(r) observes auth via r
  17. CHECK(r->status == 202) observes auth via r
  18. REQUIRE(r) observes auth via r
  19. REQUIRE(r->status == 200) observes auth via r
  20. CHECK(r->get_header_value("Content-Type") .find("text/event-stream") != std::string::npos) observes auth via r
  21. REQUIRE(at != std::string::npos) not attributed
  22. CHECK(j["id"] == 7) not attributed
  23. CHECK(j.contains("result")) not attributed
  24. REQUIRE(r) observes auth via r
  25. CHECK(r->status == 405) observes auth via r
  26. REQUIRE(r) observes auth via r
  27. CHECK(r->status == 429) observes auth via r
  28. CHECK_FALSE(fs::exists(token_file)) observes token_file via token_file

Where the product reaches it

No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.

Call flow

gh#204: the HTTP listener serves the bridge to authenticated clients only→dir→REQUIRE→start→port→slurp→token_file→token_path_for→WHEN→rpc→auth→stop

What it reaches

Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.

gh#204: the HTTP listener serves the bridge to authenticated clients only · 28 checksstart… 4 calls …entropic_versionREQ-ABI-001 · inferredstart… 6 calls …entropic_session_bind_workspaceREQ-ABI-002 · inferredstart… 6 calls …entropic_last_errorREQ-API-003 · inferredstart… 6 calls …entropic_session_bind_workspaceREQ-API-005 · inferredstart… 6 calls …entropic_last_errorREQ-API-007 · inferredstart… 4 calls …entropic_versionREQ-API-008 · inferredstart… 7 calls …claim_exclusiveREQ-API-009 · inferredstart… 8 calls …entropic_set_state_observerREQ-API-010 · inferredWHENfailure_detailREQ-API-012 · inferredstopREQ-BRIDGE-001 · inferredstart… 9 calls …resolve_data_dirREQ-CFG-008 · inferredstart… 8 calls …entropic_run_session_asREQ-IDEN-001 · inferred

and 21 more requirement paths, listed below.

Also reaches 41 requirements

Its run touches their code; that is reach, not proof.