Require revocable authorization for automatic lobby removal

This commit is contained in:
2026-10-06 23:06:04 -04:00
parent e012278bd9
commit e271f31325
18 changed files with 357 additions and 27 deletions
@@ -0,0 +1,9 @@
import { json } from '@sveltejs/kit';
import { authenticateAgent, hostApiError, objectBody } from '$lib/server/hosts/http.js';
import { claimRemovalAuthorization } from '$lib/server/autoscaling/authorization.js';
export async function POST({ request, params }: { request: Request; params: { id: string } }) {
const host = authenticateAgent(request);
try { return json(claimRemovalAuthorization(host.id, params.id, await objectBody(request, 4096))); }
catch (cause) { return hostApiError(cause); }
}