105 route tests, matrix crawl, spec and README updated. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
16 lines
775 B
C++
16 lines
775 B
C++
// Route: GET /security/secrets (values are always masked)
|
|
#include "support/Assert.hpp"
|
|
using namespace molo::example::test;
|
|
int main() {
|
|
Fixture f;
|
|
auto list = f.client->get("/security/secrets");
|
|
check(list.status == 200 && contains(list.body, "DB_PASSWORD"), "names listed");
|
|
check(!contains(list.body, "demo-db-password"), "no values in list");
|
|
auto one = f.client->get("/security/secrets?name=API_KEY");
|
|
check(one.status == 200 && contains(one.body, "de*"), "masked value");
|
|
check(!contains(one.body, "demo-api-key-abcdef"), "full value never returned");
|
|
check(f.client->get("/security/secrets?name=NOPE").status == 404, "unknown 404");
|
|
check(f.client->post("/security/secrets", "x").status == 405, "POST 405");
|
|
return finish("security/secrets");
|
|
}
|