For example, how is this enforced: "JavaScript running in the user’s browser can talk only to the document container for which it was loaded, no others."
Do apps need to be SandStorm aware? Thanks!
For example, how is this enforced: "JavaScript running in the user’s browser can talk only to the document container for which it was loaded, no others."
Do apps need to be SandStorm aware? Thanks!
To answer your questions:
> For example, how is this enforced: "JavaScript running in the user’s browser can talk only to the document container for which it was loaded, no others."
Each grain (or actually, each session on each grain) is assigned a randomly-generated subdomain. These domain names are unguessable, so there's no way for one grain to know another's domain, and anyway same-origin policy generally prevents Javascript from interfering with other domains. (In the future, we plan to further lock down the client side using Content-Security-Policy, although we haven't done this yet.)
> Do apps need to be SandStorm aware?
Yes, apps need to be packaged for Sandstorm, and that usually involves some modifications to the app. However, the modifications are usually mostly deleting code: you delete your user management and rely on Sandstorm, and you delete your multi-document management and instead let the user create multiple grains at the Sandstorm level. Typically, this work takes a few hours, though it varies depending on the app.
(It's also worth noting that apps which target exclusively Sandstorm from the start are much easier to write than normal web apps: User management, document management, security, access control, etc. are handled for you.)
See also comments by Sandbox designer kentonv in this thread.