Worker Loader: support a Fetcher for `globalOutbound` (or capability stubs in `env`)
mrjoedang opened 路
Worker Loader currently rejects a Fetcher for `globalOutbound` ("broker is not implemented yet"), and `env` accepts plain JSON only. Both marked not-yet-implemented in `js.rs::op_loader_load`, so a loaded worker cannot receive any capability from its parent.
**Use case:** multi-tenant site functions. A Durable Object cell per site loads that site's user code via `env.LOADER.get()`. The cell owns the site's storage and wants to hand the loaded code a scoped capability to it. With no stub in `env` and no outbound broker, the only bridge is inherited ambient egress plus HTTP calls back into the fleet's own router with a token, which works but gives the loaded code full network access instead of a narrow capability.
Either mechanism would close this:
- `globalOutbound: fetcher` so the parent intercepts the loaded worker's `fetch()` (upstream's intended pattern), or - capability stubs in `env` (a service/DO stub).
Tested on 0.4.0, `CELLD_WORKER_LOADER=LOADER`.
jperezrealinisubscribed2 months ago on GitHub
ctrochalakissubscribed2 months ago on GitHub
cschomburgsubscribed2 months ago on GitHub
ananis25subscribed2 months ago on GitHub
bartlomiejureferenced 9c2d299dd6ablast month on GitHub
ryreferenced e519694581dclast month on GitHub
ryreferenced 4250d366aceblast month on GitHub
ryreferenced 3127cf8e307elast month on GitHub
ryreferenced 12d5b6333fe5last month on GitHub
- RY
Fixed in v0.5.0: loaded Workers can receive service bindings and use a custom outbound Fetcher.
ryclosedlast month on GitHub
ananis25unsubscribedlast month on GitHub