-
I'm playing with ses and Compartments and packages/ses/demos/console demo is a great start, but I didn't find something similar for working with external js files. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
To load ESM, you’ll need One option is to use a tool like Browserify, Rollup, or esbuild to compile ESM down to a single script that can run in The compartment mapper is designed to permit the eventual addition of something analogous to import maps on the web. That would look a lot like We do not yet have a flat file bundle format for confined programs, but that is also a possible future feature of Compartment Mapper. We do have a bundle format based on other Endo infrastructure, on which we bootstrap SES, but it does not itself provide confinement. Other members of the Endo community, @kumavis and @Jack-Works have explored further into productionizing SES, with various other goals, like mitigating supply chain attacks against their respective platforms. The requirements and solutions are slightly different, but they build on SES too. |
Beta Was this translation helpful? Give feedback.
-
Thank you for detailed answer! :) |
Beta Was this translation helpful? Give feedback.
-
All the evaluators available by default within a compartment are virtualized, yes. That said, there is no power by default in a lockdown compartment to perform any I/O, including fetch. You'd have to explicitly endow it. |
Beta Was this translation helpful? Give feedback.
-
Thank you @mhofman :) |
Beta Was this translation helpful? Give feedback.
To load ESM, you’ll need
@endo/compartment-mapper
. In its current form, it providesimportLocation
, which is suitable for loading packages laid out in anode_modules
tree. It can also build an archive inzip
format and read it out later, withmakeArchive
andimportArchive
. This may be enough to get you going in the right direction, but to securely load ESM on the web, you will probably need something analogous but not the same.One option is to use a tool like Browserify, Rollup, or esbuild to compile ESM down to a single script that can run in
Compartment().evaluate(script)
. That works pretty well today.The compartment mapper is designed to permit the eventual addition of something anal…