-
Notifications
You must be signed in to change notification settings - Fork 1
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
update: esm source design #3
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
guybedford
commented
Mar 21, 2024
guybedford
commented
Mar 21, 2024
guybedford
commented
Mar 21, 2024
@nicolo-ribaudo I have added the changes we discussed in todays meting, including the new identity handling. |
nicolo-ribaudo
approved these changes
Mar 22, 2024
This document leaves open what happens when you |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This outlines an initial design sketch for the ESM source phase design, covering:
module.exports()
andmodule.imports()
APIsimport()
integration rulesIn an initial version I explicitly defined the CSP property for a
[[HostSrc]]
internal slot that might be directly checked in the CSP policy rules for example in the Wasm ESM integration.But on further consideration, CSP as a compilation check, means that by having a source phase import that the compilation guard has already passed - thus if you have a handle to a concrete
AbstractModuleSource
, then it's already passed through CSP. Similarly for JS, dynamic import of a module guards the module at fetch time, not execution time.Therefore, it is only the
new Worker(module)
invocation that needs to be supported here from a CSP perspective as a new construct for permitting CSP sources that have already been vetted statically.Then I think for that case that we can rather define that the
src
can be reconstructed from[[HostDefined]]
in order to perform the verification here. If there are difficulties figuring that out, then I think that is a CSP integration problem we should handle when we get there, but that we don't necessarily need right now to introduce new machinery to handle it without trying the simpler approach first.