Repository navigation
feat: add support for same-origin SRI allowing use of strict Integrity-Policy - #15435
willfarrell wants to merge 13 commits into
Conversation
Signed-off-by: will Farrell <willfarrell@proton.me>
Signed-off-by: will Farrell <willfarrell@proton.me>
|
Signed-off-by: will Farrell <willfarrell@proton.me>
|
I've been reflecting on this implementation. I feel like pulling out the automated Integrity-Policy part makes the most sense. Keeps it cleaner, simplified documentation. Let me know your thoughts. |
Signed-off-by: will Farrell <willfarrell@proton.me>
Signed-off-by: will Farrell <willfarrell@proton.me>
Signed-off-by: will Farrell <willfarrell@proton.me>
|
Install the latest version of pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/ffe1f62152d5cb9bfde8606a3263025fdc863ae1Open in Note This PR is from a fork. A maintainer must approve approve each commit before it can be built and installed. |
Signed-off-by: will Farrell <willfarrell@proton.me>
|
Closing, redone off v3 main #17399 |
Summary
Adds Subresource Integrity (SRI) support to SvelteKit — automatic integrity hashes on all framework-managed scripts and stylesheets, a new $app/integrity module for user-controlled assets. When Integrity-Policy is set to be strict, framework-managed assets will fail to load due to missing SRI.
What this does
New config options (top-level under kit, alongside csp/csrf):
Automatic SRI on framework assets (render.js):
New $app/integrity module:
Build pipeline (vite/index.js):
Built to be opt-in only.
AI disclosure: Planned by Gemini 3.1 Pro using deep thinking. Implemented by Claude Opus 4.6. Reviewed and tested by human.
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Which packages should have a major bump?, but doesn't let me set it as a minor version.Edits