feat(workflow): example covers security, platform, enterprise and resilience features

105 route tests, matrix crawl, spec and README updated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-24 02:19:52 +02:00
co-authored by Claude Sonnet 5.5
parent 00af65613d
commit 62fdd08da8
90 changed files with 8038 additions and 11 deletions
+26
View File
@@ -0,0 +1,26 @@
// Route: /data/ttl (TTL expiry, LRU eviction, pubsub events)
#include "support/Assert.hpp"
using namespace molo::example::test;
using molo::example::fw::Method;
static const char* kForm = "application/x-www-form-urlencoded";
int main() {
Fixture f;
check(f.client->get("/data/ttl").status == 200, "status 200");
f.client->post("/data/ttl/set", "key=a&value=1&ttl_s=5", kForm);
check(contains(f.client->post("/data/ttl/get", "key=a", kForm).body, "hit: 1"), "hit");
f.client->post("/data/ttl/tick", "", kForm);
auto gone = f.client->post("/data/ttl/get", "key=a", kForm);
check(contains(gone.body, "miss") && contains(gone.body, "expired a"), "expired after ttl, event published");
for (int i = 0; i < 6; ++i)
f.client->post("/data/ttl/set", "key=k" + std::to_string(i) + "&value=v&ttl_s=60", kForm);
auto page = f.client->get("/data/ttl");
check(contains(page.body, "5/5"), "capacity capped at 5");
check(contains(page.body, "evicted k0 (lru)"), "oldest key evicted");
auto bad = f.client->post("/data/ttl/set", "key=&value=x&ttl_s=0", kForm);
check(bad.status == 422 && contains(bad.body, "is required"), "422 missing key");
check(f.client->post("/data/ttl/set", "key=a&value=b&ttl_s=999", kForm).status == 422, "422 ttl above cap");
return finish("data/ttl");
}