Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for running script inside a sandbox #169

Merged
merged 4 commits into from
Mar 9, 2022
Merged

Conversation

jgraham
Copy link
Member

@jgraham jgraham commented Jan 12, 2022

This adds the API surface for running script inside a sandbox whilst omitting all detail about how a sandbox might work.

The API model is that when executing script in a context you can provide a sandbox name, which will cause a sandbox with that name to be used, creating it if necessary. If you already created the sandobx, you can also use the realm id directly.

This currently doesn't add any addition functionality inside the sandbox except for the sandboxing.


💥 Error: 500 Internal Server Error 💥

PR Preview failed to build. (Last tried on Mar 9, 2022, 4:38 PM UTC).

More

PR Preview relies on a number of web services to run. There seems to be an issue with the following one:

🚨 CSS Spec Preprocessor - CSS Spec Preprocessor is the web service used to build Bikeshed specs.

🔗 Related URL

Error running preprocessor, returned code: 1.
Traceback (most recent call last):
  File "/sites/api.csswg.org/bikeshed/bikeshed.py", line 3, in 
    from bikeshed import cli
  File "/sites/api.csswg.org/bikeshed/bikeshed/__init__.py", line 65, in 
    from . import config  # noqa: E402
  File "/sites/api.csswg.org/bikeshed/bikeshed/config/__init__.py", line 2, in 
    from .dfnTypes import (
  File "/sites/api.csswg.org/bikeshed/bikeshed/config/dfnTypes.py", line 4, in 
    from .. import t
  File "/sites/api.csswg.org/bikeshed/bikeshed/t.py", line 6, in 
    from typing import (
ImportError: cannot import name 'Literal' from 'typing' (/usr/local/lib/python3.7/typing.py)

If you don't have enough information above to solve the error by yourself (or to understand to which web service the error is related to, if any), please file an issue.

index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
## SandboxWindowProxy ## {#sandbox-sandboxwindowproxy}

<xmp class=idl>
[Exposed=]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[Exposed=]
[Exposed=Window]

Maybe?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. It isn't actually constructable from JS, or accessible from a Window global. But of course you can access as the global of a sandbox.

index.bs Outdated Show resolved Hide resolved
This allows us to get a realm id back when we execute in a sandbox.
The main change here is that the target type allows specifying a
sandbox name, and when a name is supplied, we got or create a sandbox
for the given context with the given name.

The details of how sandboxes actually work are intentionally elided
for now, since that's more complex to specify. But some non-normative
hints about their properties are given to sketch out the direction in
which things are moving.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants