endojs / endo

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

Add a GET_INTERFACE_GUARD meta method to all exo/far objects. #1844

Closed erights closed 10 months ago

erights commented 1 year ago

See https://github.com/endojs/endo/pull/1809#discussion_r1376929120

Currently, before https://github.com/endojs/endo/pull/1809 and possibly after (depending on the resolution of the conversation linked above), only exo objects declared with an explicit interfaceGuard get an additional GET_INTERFACE_GUARD meta-method added to their behavior. As @michaelfig observes there, this creates an unpleasant sniffing burden on clients. Further, even in that case, if the user-supplied interfaceGuard has a defaultGuards argument other than undefined, the exo/far object may still have actual methods that cannot be discovered by looking at the returned interface guard.

The best repair would be to return a constructed interface guard in all cases that accurately describes all the methods on the actual exo/far object

For extra credit

kriskowal commented 10 months ago

@erights Am I right that this work is completed?

erights commented 10 months ago

@erights Am I right that this work is completed?

Yes, but differently from the issue's description. See

https://github.com/endojs/endo/blob/master/packages/exo/README.md

and

https://github.com/endojs/endo/blob/4c67fe2cbcfd2737cb389b3fb0e358f4eed58af0/packages/pass-style/src/make-far.js#L132-L146

Thus, closing. Thanks!

erights commented 10 months ago

Closed by https://github.com/endojs/endo/pull/1809