denoland/celldPublic

self-hosted, distributed Durable Objects

Worker Loader: support a Fetcher for `globalOutbound` (or capability stubs in `env`)

MR

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`.

  1. jperezrealinisubscribed2 months ago on GitHub

  2. ctrochalakissubscribed2 months ago on GitHub

  3. cschomburgsubscribed2 months ago on GitHub

  4. ananis25subscribed2 months ago on GitHub

  5. bartlomiejureferenced 9c2d299dd6ablast month on GitHub

  6. ryreferenced e519694581dclast month on GitHub

  7. ryreferenced 4250d366aceblast month on GitHub

  8. ryreferenced 3127cf8e307elast month on GitHub

  9. ryreferenced 12d5b6333fe5last month on GitHub

  10. RY

    Fixed in v0.5.0: loaded Workers can receive service bindings and use a custom outbound Fetcher.

  11. ryclosedlast month on GitHub

  12. ananis25unsubscribedlast month on GitHub