- SQLite database with full schema: users, roles, permissions, role_permissions, user_roles, services, audit_log - RBAC engine with wildcard permission resolution (*.*.*) - Automatic v2→v3 migration from JSON files - 5 default roles: super_admin, admin, editor, user, viewer - Feature registration for APP, GGL, FDX (119 permissions) - 8 services seeded - Full API: roles CRUD, permission check, user-role assignment, feature registration, audit log, stats - Backward compatible with existing auth flows
34 lines
942 B
JavaScript
34 lines
942 B
JavaScript
const http = require("http");
|
|
|
|
// Simulate what access-manager does - call oauth2-proxy auth endpoint
|
|
// with the cookie from the browser
|
|
const cookie = process.argv[2] || "";
|
|
const host = process.argv[3] || "docs.scottfelten.com";
|
|
|
|
console.log("Testing oauth2-proxy auth with:");
|
|
console.log(" Cookie length:", cookie.length);
|
|
console.log(" Host:", host);
|
|
|
|
const opts = {
|
|
hostname: "127.0.0.1",
|
|
port: 4180,
|
|
path: "/oauth2/auth",
|
|
method: "GET",
|
|
headers: {
|
|
Cookie: cookie,
|
|
"X-Forwarded-Proto": "https",
|
|
Host: host,
|
|
},
|
|
};
|
|
|
|
const req = http.request(opts, (res) => {
|
|
console.log("\noauth2-proxy response:");
|
|
console.log(" Status:", res.statusCode);
|
|
console.log(" Headers:", JSON.stringify(res.headers, null, 2));
|
|
let body = "";
|
|
res.on("data", (d) => (body += d));
|
|
res.on("end", () => { if (body) console.log(" Body:", body); });
|
|
});
|
|
|
|
req.on("error", (e) => console.error("Error:", e.message));
|
|
req.end();
|