Enforce claim permission and bounded full USB enrollment envelopes
Device Core qualification / qualify (push) Successful in 8m31s
Device Core qualification / qualify (push) Successful in 8m31s
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user