feat: implement MoloApp plans 01-15 with integration
Full C++23 framework tree: runtime, observability, security, data, app, realtime, supervisor, clients, CLI, example plus enterprise tenancy, audit, operability, governance, supplychain. Postgres via docker compose for tests.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
// Route: GET /auth/me (Basic auth)
|
||||
#include "support/Assert.hpp"
|
||||
|
||||
using namespace molo::example::test;
|
||||
using molo::example::fw::Method;
|
||||
|
||||
int main() {
|
||||
Fixture f;
|
||||
auto anon = f.client->get("/auth/me");
|
||||
check(anon.status == 401, "no header is 401");
|
||||
auto bad = f.client->request(
|
||||
Method::Get, "/auth/me", "",
|
||||
{{"Authorization", "Basic YWRhOndyb25n"}});
|
||||
check(bad.status == 403, "bad password is 403");
|
||||
auto ok = f.client->request(
|
||||
Method::Get, "/auth/me", "",
|
||||
{{"Authorization", "Basic YWRhOmNvcnJlY3QtaG9yc2U="}});
|
||||
check(ok.status == 200, "good credentials are 200");
|
||||
check(contains(ok.body, "\"user\":\"ada\""), "identity returned");
|
||||
return finish("auth/me");
|
||||
}
|
||||
Reference in New Issue
Block a user