feat(state,registry): back StateStore with Void::Sqlite when available and filter audit queries
This commit is contained in:
1 parent
9a6f209f5b
commit
e990f44037
8 files changed
+387
-34
No files matched your search
@@ -228,7 +228,23 @@ VOID_TEST(RegistryTests, registry_rbac_immutability_csrf_xss_web_and_backup_rest
|
||||
if (audit) {
|
||||
Void::Testing::expect(audit->body.find("admin_secret_password") == std::string::npos);
|
||||
Void::Testing::expect(audit->body.find(*alice_tok) == std::string::npos);
|
||||
Void::Testing::expect(audit->body.find("\"total\":") != std::string::npos);
|
||||
}
|
||||
auto filtered_audit = send_loopback_http(port, "GET", "/api/v1/audit?limit=1&action=package",
|
||||
{{"Cookie", cookie}});
|
||||
Void::Testing::expect(filtered_audit.has_value() && filtered_audit->status == 200);
|
||||
if (filtered_audit) {
|
||||
Void::Testing::expect(filtered_audit->body.find("\"limit\":1") != std::string::npos);
|
||||
std::size_t action_occurrences = 0;
|
||||
for (std::size_t pos = filtered_audit->body.find("\"action\":"); pos != std::string::npos;
|
||||
pos = filtered_audit->body.find("\"action\":", pos + 1)) {
|
||||
++action_occurrences;
|
||||
}
|
||||
Void::Testing::expect(action_occurrences == 1);
|
||||
}
|
||||
auto bad_audit_limit =
|
||||
send_loopback_http(port, "GET", "/api/v1/audit?limit=5000", {{"Cookie", cookie}});
|
||||
Void::Testing::expect(bad_audit_limit.has_value() && bad_audit_limit->status == 400);
|
||||
|
||||
// Package search pagination: bounded page plus total/limit/offset envelope.
|
||||
auto page = send_loopback_http(port, "GET", "/api/v1/packages?limit=1&offset=0");
|
||||
|
||||
Reference in new issue
Block a user