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>
21 lines
809 B
C++
21 lines
809 B
C++
// Route: POST /agent/registry/approve
|
|
#include "agent/registry/cases.hpp"
|
|
|
|
using namespace molo::example::test;
|
|
|
|
int main() {
|
|
check_google_post_route("/agent/registry/approve",
|
|
"{\"name\":\"projects/test-project/locations/us-central1/agents/a1\",\"actor\":\"alice\"}",
|
|
"{\"name\":\"agents/a1\",\"actor\":\"alice\"}",
|
|
"short asset name");
|
|
{
|
|
GoogleRig rig;
|
|
Fixture f(rig.client);
|
|
check(f.client->post("/agent/registry/approve", "{\"name\":\"projects/test-project/locations/us-central1/agents/a1\"}", "application/json").status == 422,
|
|
"missing actor is 422");
|
|
check(contains(f.client->get("/agent/registry/approvals").body, "\"approvals\":[]"),
|
|
"side effect: nothing recorded after rejected requests");
|
|
}
|
|
return finish("agent/registry/approve");
|
|
}
|