endojs / endo

Endo is a distributed secure JavaScript sandbox, based on SES
Apache License 2.0
829 stars 72 forks source link

feat(daemon): Undeniable host INFO tool #1916

Closed kriskowal closed 9 months ago

kriskowal commented 10 months ago

Problem: Commands like endo make counter.js --name counter implicitly create a unique worker for the counter. This makes it impossible to address the worker for follow-up commands, like an eval co-located with the counter.

This change introduces an undeniable INFO name to all hosts that allows the host to address the values used to create pet named values. For example, INFO -> counter -> worker addresses the worker that was used to create counter. Until we have pet name path lookup (#1915), you need multiple invocations of E() to perform of depth greater than 1, for example:

> endo make counter.js --name counter
  Object [Alleged: Counter] {}
> endo eval 'E(INFO).lookup("counter")' INFO --name inspector
  Object [Alleged: Inspector (make-bundle ... )]
> endo eval 'E(inspector).lookup("worker")' inspector
  Object [Alleged: EndoWorker] {}

This facility is intended to compose well with follow-up changes for inspecting a worker’s log or copy one of these “unnamed” capabilities to a name.