Intrinsic internal capability and package type #61
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The idea is that the package type and internal capability can be the standard way of sealing types and commands that are meant to be internal. The package type also provides programmatic access to package internal data---currently this is used to implement sandboxed file systems for each package---in the browser this is done by generating a set of routes with opaque tokens in them, this token is then granted to each package and used to generate the URL for each asset file.
There's quite a lot that still needs to be done to make this actually safe, but won't be done in this PR. Plus this change does highlight the need of adding support for optional capabilities before the stable release, as otherwise we're forced to grant strong capabilities just to load a package.
This patch also removes the dependency on uuid, as the only one we care about (random 128 bit UUID) is provided natively by both browsers and Node.