endojs / endo

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

feat(daemon): Add `locate()` facility #2160

Closed rekmarks closed 4 months ago

rekmarks commented 4 months ago

Adds locator strings and a locate() method to the daemon's directory abstraction, and thereby hosts and guests. A locator string is a URL of the following form:

endo://{nodeIdentifier}/?id={formulaNumber}&type={formulaType}

Formula identifiers are of the form {formulaNumber}:{nodeIdentifier}. Therefore, we can say that a locator is the URL form of the formula identifier, annotated with the formulaType. If a value is remote, i.e. belonging to a different peer, we set the type query param to remote to indicate this. remote is not a valid formula type in the general case—i.e. there are no formula objects with that type—but perhaps it should be.

Note that the id query param is just the formulaNumber, not the formula identifier. We may address this internal discrepancy in naming by using locators and formula numbers instead of the {formulaNumber}:{nodeIdentifier} construction.