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

feat: support importmap integrity #424

Merged
merged 3 commits into from
Apr 28, 2024
Merged

feat: support importmap integrity #424

merged 3 commits into from
Apr 28, 2024

Conversation

guybedford
Copy link
Owner

This adds support for picking up integrity from the import map itself when polyfilling.

Before this feature is shipped in Chrome, this will mostly be useful for shim mode to ensure full integrity for all modules, but once it ships it allows us to ensure that the polyfill also validates integrities provided via the import map.

This implementation supports integrity in import map extensions with multiple import maps, providing an error when the integrity is overridden so that the first integrity in the import map for a given URL is always authoritative.

Explicit preload and script integrities still override the import map integrity value.

This feature is fully compatible with the existing enforceIntegrity option for ensuring that all modules are loaded with integrity.

//cc @yoavweiss this can be considered an implementation of the feature

@guybedford guybedford merged commit 1ac6306 into main Apr 28, 2024
7 checks passed
@guybedford guybedford deleted the map-integrity branch April 28, 2024 00:03
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.

1 participant