@isomorph.ai/app-sdk 2.8.0 → 2.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/runtime.js +8 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -413,8 +413,10 @@ The call goes through this app's own gateway with the workload token and the per
|
|
|
413
413
|
`RATE_LIMITED`). It works only from an action a signed-in person started: a job keeps using a service credential.
|
|
414
414
|
A journey of the called app plays the caller with a POST to `/_harbour/api/<action>` carrying
|
|
415
415
|
`X-Harbour-Call-Host: <caller address>` and one of the check's identity tokens as the bearer.
|
|
416
|
+
The input may be up to 16 MiB (5 MiB when the called app runs on a serverless cell), as on the direct
|
|
417
|
+
integration route; the answer stays at most 4 MiB.
|
|
416
418
|
|
|
417
|
-
(2.8.0; data plane ADR 2026-11-07)
|
|
419
|
+
(2.8.0, input limits 2.8.1; data plane ADR 2026-11-07)
|
|
418
420
|
|
|
419
421
|
## Browser read tools
|
|
420
422
|
|
package/dist/runtime.js
CHANGED
|
@@ -90,6 +90,9 @@ export const CANCEL_RUN_ACTION = 'isomorph-jobs-cancel';
|
|
|
90
90
|
export const LIST_RUNS_ACTION = 'isomorph-jobs-list';
|
|
91
91
|
const LOGICAL_NAME = /^[a-z0-9][a-z0-9_-]{0,63}$/;
|
|
92
92
|
const MAX_BODY_BYTES = 1 << 20;
|
|
93
|
+
// Another app's call (ctx.caller) carries what the gateway's direct route admits: 16 MiB to a cluster runtime, 5 MiB
|
|
94
|
+
// to a Lambda; the gateway holds every other entrance to 1 MiB.
|
|
95
|
+
const APP_CALL_MAX_BODY_BYTES = 16 << 20;
|
|
93
96
|
const LEASE_MS = 5 * 60_000;
|
|
94
97
|
const QUEUE_WORKERS = 2;
|
|
95
98
|
const QUEUE_POLL_MS = 2_000;
|
|
@@ -225,12 +228,12 @@ function refusal(error) {
|
|
|
225
228
|
return { status: REFUSAL_STATUS[code], category: code, message: error.message };
|
|
226
229
|
return undefined;
|
|
227
230
|
}
|
|
228
|
-
async function readBody(request) {
|
|
231
|
+
async function readBody(request, limit = MAX_BODY_BYTES) {
|
|
229
232
|
const chunks = [];
|
|
230
233
|
let size = 0;
|
|
231
234
|
for await (const chunk of request) {
|
|
232
235
|
size += chunk.length;
|
|
233
|
-
if (size >
|
|
236
|
+
if (size > limit)
|
|
234
237
|
return undefined;
|
|
235
238
|
chunks.push(chunk);
|
|
236
239
|
}
|
|
@@ -814,9 +817,10 @@ export class Runtime {
|
|
|
814
817
|
};
|
|
815
818
|
const caller = verifiedCaller(request);
|
|
816
819
|
const context = { computerView: header(request, 'X-Harbour-Computer-View') === '1', signal: controller.signal, user, tenant, app, requestId: requestId ?? '', progress, transaction: (fn) => this.transaction(name, fn), ...(caller ? { caller } : {}) };
|
|
817
|
-
const
|
|
820
|
+
const limit = caller ? APP_CALL_MAX_BODY_BYTES : MAX_BODY_BYTES;
|
|
821
|
+
const raw = await readBody(request, limit);
|
|
818
822
|
if (raw === undefined)
|
|
819
|
-
return refuse(response, 413, 'VALIDATION_FAILED',
|
|
823
|
+
return refuse(response, 413, 'VALIDATION_FAILED', `the request body is larger than ${limit >> 20} MiB`, requestId);
|
|
820
824
|
if (name === 'isomorph-mail-arrival' && header(request, 'X-Harbour-Verified-Hook')) {
|
|
821
825
|
// The gateway's hooks route: the provider's raw body and headers, the gateway's verified
|
|
822
826
|
// headers beside them. The answer is what the provider reads, so it is not enveloped.
|