feat(clients): registry: Agent Registry, Agent Gateway, Agent Identity from discovery call table
86-row call table checked against Google discovery documents, typed services, local approval ledger, live read-only tests, /agent/registry demo. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
// Route: DELETE /agent/registry/services/{id} and /gateways/{id} (explicit destructive routes)
|
||||
#include "support/GoogleRig.hpp"
|
||||
#include <cstdlib>
|
||||
|
||||
using namespace molo::example::test;
|
||||
using molo::example::fw::Method;
|
||||
|
||||
int main() {
|
||||
setenv("GOOGLE_CLOUD_PROJECT", "test-project", 1);
|
||||
{
|
||||
GoogleRig rig(false);
|
||||
Fixture f(rig.client);
|
||||
auto res = f.client->request(Method::Delete, "/agent/registry/services/my-service");
|
||||
check(res.status == 503 && contains(res.body, "google_not_configured"), "service delete: 503 without a credential");
|
||||
auto gw = f.client->request(Method::Delete, "/agent/registry/gateways/gw1");
|
||||
check(gw.status == 503 && contains(gw.body, "google_not_configured"), "gateway delete: 503 without a credential");
|
||||
check(rig.mock->send_count() == 0, "no upstream traffic");
|
||||
}
|
||||
{
|
||||
GoogleRig rig;
|
||||
Fixture f(rig.client);
|
||||
check(f.client->request(Method::Delete, "/agent/registry/services/BAD").status == 422, "bad service id is 422");
|
||||
check(f.client->request(Method::Delete, "/agent/registry/gateways/a..b").status == 422, "bad gateway id is 422");
|
||||
check(f.client->get("/agent/registry/services/my-service").status == 405, "get is 405: never deletes by accident");
|
||||
check(f.client->post("/agent/registry/services/my-service").status == 405, "post is 405");
|
||||
check(rig.mock->send_count() == 0, "side effect: rejected before any upstream call");
|
||||
}
|
||||
return finish("agent/registry/delete");
|
||||
}
|
||||
Reference in New Issue
Block a user