refactor #22

Merged
hzhang merged 33 commits from refactor into main 2026-04-10 07:49:57 +00:00
Showing only changes of commit b9cbb7e895 - Show all commits

View File

@@ -102,7 +102,7 @@ export function registerControlPage(deps: {
// ── Main page ──────────────────────────────────────────────────────────────
api.registerHttpRoute({
path: "/dirigent",
auth: "gateway",
auth: "plugin",
match: "exact",
handler: async (_req, res) => {
const entries = identityRegistry.list();
@@ -219,7 +219,7 @@ export function registerControlPage(deps: {
// ── API: add identity ──────────────────────────────────────────────────────
api.registerHttpRoute({
path: "/dirigent/api/identity",
auth: "gateway",
auth: "plugin",
match: "exact",
handler: (req, res) => {
if (req.method !== "POST") { res.writeHead(405); res.end(); return; }
@@ -243,7 +243,7 @@ export function registerControlPage(deps: {
// ── API: remove identity ───────────────────────────────────────────────────
api.registerHttpRoute({
path: "/dirigent/api/identity/",
auth: "gateway",
auth: "plugin",
match: "prefix",
handler: (req, res) => {
if (req.method !== "DELETE") { res.writeHead(405); res.end(); return; }
@@ -257,7 +257,7 @@ export function registerControlPage(deps: {
// ── API: set channel mode ──────────────────────────────────────────────────
api.registerHttpRoute({
path: "/dirigent/api/channel-mode",
auth: "gateway",
auth: "plugin",
match: "exact",
handler: (req, res) => {
if (req.method !== "POST") { res.writeHead(405); res.end(); return; }
@@ -282,7 +282,7 @@ export function registerControlPage(deps: {
// ── API: rescan padded-cell ────────────────────────────────────────────────
api.registerHttpRoute({
path: "/dirigent/api/rescan-padded-cell",
auth: "gateway",
auth: "plugin",
match: "exact",
handler: (req, res) => {
if (req.method !== "POST") { res.writeHead(405); res.end(); return; }