Enforce claim permission and bounded full USB enrollment envelopes
Device Core qualification / qualify (push) Successful in 8m31s

This commit is contained in:
DCCONSTRUCTIONS
2026-10-01 09:33:04 +03:00
parent dc9fe6e0fc
commit be30fafa95
6 changed files with 32 additions and 3 deletions
+1 -1
View File
@@ -211,7 +211,7 @@ export function createControlCoreApp({
const requestId = String(request.headers["idempotency-key"] || "");
if (!/^[a-f0-9]{32}$/.test(requestId)) throw new TypeError("b2_request_id_invalid");
const actor = managementActorFromHeaders(request.headers);
const input = await readJsonBody(request, 64 * 1024);
const input = await readJsonBody(request, 128 * 1024);
const result = await b2Infrastructure.execute(actor, input, requestId);
return writeJson(response, 200, { ok: true, result });
}
@@ -204,6 +204,7 @@ export class B2Infrastructure {
try {
await db.query('begin');
await findProjectWithCapability(db, actor, projectId, 'device.enroll');
if (request.action === 'register') await findProjectWithCapability(db, actor, projectId, 'device.claim');
source = (await db.query(`select s.* from device_b2_hosts s
join device_b2_host_views v on v.source_id=s.id
join device_b2_contour_links l on l.source_id=s.id and l.project_id=v.project_id