{"_id":"@douganderson444/integrity-app","_rev":"3-e0335d6822118f089fc18a1ecba0a3a6","name":"@douganderson444/integrity-app","description":"A SvelteKit app with built-in subresource integrity","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.0":{"name":"@douganderson444/integrity-app","version":"0.1.0","license":"MIT","_id":"@douganderson444/integrity-app@0.1.0","homepage":"https://github.com/DougAnderson444/integrity-app#readme","bugs":{"url":"https://github.com/DougAnderson444/integrity-app","email":"douganderson444+github-integrity-app@gmail.com"},"dist":{"shasum":"c8463a884fc141bfd9cf5fa48e233098f64fd9df","tarball":"https://registry.npmjs.org/@douganderson444/integrity-app/-/integrity-app-0.1.0.tgz","fileCount":13,"integrity":"sha512-lf6rjezixUm6BStNmTXEm2PiI9NG2iaHYVSLnV/rQg4Z0cZ8lyntJhbi7FRGhrNutRqUjGQABhJK5X9Dn22F+A==","signatures":[{"sig":"MEQCIA7tY0dCMbSKHLDSzKsXpX0ZYRais2yvJuwKRBHZoglkAiAdqL0LSQGgGydR/EJxfHiP5HDnikrsBQY9Ehy2F8ZcqQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19549},"type":"module","exports":{".":{"types":"./dist/index.d.ts","svelte":"./dist/index.js"},"./Format.svelte":{"types":"./dist/Format.svelte.d.ts","svelte":"./dist/Format.svelte"},"./Integrity.svelte":{"types":"./dist/Integrity.svelte.d.ts","svelte":"./dist/Integrity.svelte"}},"gitHead":"95ec33dcd1fed95e1b65c87c799bb5458a8d089f","scripts":{"dev":"vite dev","lint":"prettier --check . && eslint .","test":"npm run test:integration && npm run test:unit","build":"vite build","check":"svelte-kit sync && svelte-check --tsconfig ./jsconfig.json","format":"prettier --write .","package":"svelte-kit sync && svelte-package && publint","preview":"vite preview","test:unit":"vitest","check:watch":"svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch","test:integration":"playwright test"},"_npmUser":{"name":"douganderson444","email":"douganderson444@gmail.com"},"_npmVersion":"10.8.1","description":"A SvelteKit app with built-in subresource integrity","directories":{},"_nodeVersion":"20.12.2","publishConfig":{"access":"public"},"typesVersions":{">4.0":{"*":["./dist/*"]}},"_hasShrinkwrap":false,"devDependencies":{"vite":"^5.3.1","eslint":"^8.56.0","svelte":"^4.2.7","vitest":"^1.2.0","postcss":"^8.4.38","publint":"^0.2.8","prettier":"^3.1.1","typescript":"^5.0.0","tailwindcss":"^3.4.3","autoprefixer":"^10.4.19","svelte-check":"^3.6.0","@sveltejs/kit":"^2.0.0","@types/eslint":"^8.56.0","@playwright/test":"^1.28.1","@stablelib/base64":"^1.0.1","@sveltejs/package":"^2.3.2","eslint-plugin-svelte":"^2.35.1","@sveltejs/adapter-auto":"^3.0.0","eslint-config-prettier":"^9.1.0","prettier-plugin-svelte":"^3.1.2","@sveltejs/adapter-static":"^3.0.1","@sveltejs/vite-plugin-svelte":"^3.0.0"},"peerDependencies":{"svelte":"^4.0.0","@sveltejs/kit":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/integrity-app_0.1.0_1719339879278_0.5034474986665685","host":"s3://npm-registry-packages"}},"0.1.1":{"name":"@douganderson444/integrity-app","version":"0.1.1","license":"MIT","_id":"@douganderson444/integrity-app@0.1.1","homepage":"https://github.com/DougAnderson444/integrity-app#readme","bugs":{"url":"https://github.com/DougAnderson444/integrity-app","email":"douganderson444+github-integrity-app@gmail.com"},"dist":{"shasum":"7dabbc3193da62d6c37642fbcd34c713a1a56481","tarball":"https://registry.npmjs.org/@douganderson444/integrity-app/-/integrity-app-0.1.1.tgz","fileCount":13,"integrity":"sha512-N5TNp5tT7iZeLw18iIcpSr5rnQ6XPS/Vr+eTDtti94WuKP2H/0v0WruOxSHZgFtRUZcie1dLe920FlOaN1my2g==","signatures":[{"sig":"MEUCIQD9D3bb6oYccJvGgJKXbN8TzV7Dnmm0KBCZiijkN5lufgIgOdvh2uniVJ9qUvgY9AgqGlCzoue5K0eMg6DAO389G9M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19571},"type":"module","exports":{".":{"types":"./dist/index.d.ts","svelte":"./dist/index.js"},"./Format.svelte":{"types":"./dist/Format.svelte.d.ts","svelte":"./dist/Format.svelte"},"./Integrity.svelte":{"types":"./dist/Integrity.svelte.d.ts","svelte":"./dist/Integrity.svelte"}},"gitHead":"95ec33dcd1fed95e1b65c87c799bb5458a8d089f","scripts":{"dev":"vite dev","lint":"prettier --check . && eslint .","test":"npm run test:integration && npm run test:unit","build":"vite build","check":"svelte-kit sync && svelte-check --tsconfig ./jsconfig.json","format":"prettier --write .","package":"svelte-kit sync && svelte-package && publint","preview":"vite preview","test:unit":"vitest","check:watch":"svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch","test:integration":"playwright test"},"_npmUser":{"name":"douganderson444","email":"douganderson444@gmail.com"},"_npmVersion":"10.8.1","description":"A SvelteKit app with built-in subresource integrity","directories":{},"_nodeVersion":"20.12.2","dependencies":{"@stablelib/base64":"^1.0.1"},"publishConfig":{"access":"public"},"typesVersions":{">4.0":{"*":["./dist/*"]}},"_hasShrinkwrap":false,"devDependencies":{"vite":"^5.3.1","eslint":"^8.56.0","svelte":"^4.2.7","vitest":"^1.2.0","postcss":"^8.4.38","publint":"^0.2.8","prettier":"^3.1.1","typescript":"^5.0.0","tailwindcss":"^3.4.3","autoprefixer":"^10.4.19","svelte-check":"^3.6.0","@sveltejs/kit":"^2.0.0","@types/eslint":"^8.56.0","@playwright/test":"^1.28.1","@sveltejs/package":"^2.3.2","eslint-plugin-svelte":"^2.35.1","@sveltejs/adapter-auto":"^3.0.0","eslint-config-prettier":"^9.1.0","prettier-plugin-svelte":"^3.1.2","@sveltejs/adapter-static":"^3.0.1","@sveltejs/vite-plugin-svelte":"^3.0.0"},"peerDependencies":{"svelte":"^4.0.0","@sveltejs/kit":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/integrity-app_0.1.1_1719340485949_0.5180042031038685","host":"s3://npm-registry-packages"}},"0.1.2":{"name":"@douganderson444/integrity-app","version":"0.1.2","license":"MIT","_id":"@douganderson444/integrity-app@0.1.2","homepage":"https://github.com/DougAnderson444/integrity-app#readme","bugs":{"url":"https://github.com/DougAnderson444/integrity-app","email":"douganderson444+github-integrity-app@gmail.com"},"dist":{"shasum":"21e9d5c8e0e0a6485efbd561f8cd41395a96f962","tarball":"https://registry.npmjs.org/@douganderson444/integrity-app/-/integrity-app-0.1.2.tgz","fileCount":13,"integrity":"sha512-i/wNpgBV770C5x6WBqIElVOTdbKAZQH9gwTfb3JvYpBbOQTb8Y9/DWud0S/B2iex3C/UXBniZdpB5mQ1nlz6GQ==","signatures":[{"sig":"MEYCIQCInPnmOZq4vUDOFD1Cbc4P0YUuBhxs+vB/wMoPMZ0L3AIhAM3vDxvv/jdba4/udrt3ogw2w/NqmDFLxoYjPPaN5AiR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24390},"type":"module","exports":{".":{"types":"./dist/index.d.ts","svelte":"./dist/index.js"},"./Format.svelte":{"types":"./dist/Format.svelte.d.ts","svelte":"./dist/Format.svelte"},"./Integrity.svelte":{"types":"./dist/Integrity.svelte.d.ts","svelte":"./dist/Integrity.svelte"}},"gitHead":"95ec33dcd1fed95e1b65c87c799bb5458a8d089f","scripts":{"dev":"vite dev","lint":"prettier --check . && eslint .","test":"npm run test:integration && npm run test:unit","build":"vite build","check":"svelte-kit sync && svelte-check --tsconfig ./jsconfig.json","format":"prettier --write .","package":"svelte-kit sync && svelte-package && publint","preview":"vite preview","test:unit":"vitest","check:watch":"svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch","test:integration":"playwright test"},"_npmUser":{"name":"douganderson444","email":"douganderson444@gmail.com"},"_npmVersion":"10.8.1","description":"A SvelteKit app with built-in subresource integrity","directories":{},"_nodeVersion":"20.12.2","dependencies":{"@stablelib/base64":"^1.0.1"},"publishConfig":{"access":"public"},"typesVersions":{">4.0":{"*":["./dist/*"]}},"_hasShrinkwrap":false,"devDependencies":{"vite":"^5.3.1","eslint":"^8.56.0","svelte":"^4.2.7","vitest":"^1.2.0","postcss":"^8.4.38","publint":"^0.2.8","prettier":"^3.1.1","typescript":"^5.0.0","tailwindcss":"^3.4.3","autoprefixer":"^10.4.19","svelte-check":"^3.6.0","@sveltejs/kit":"^2.0.0","@types/eslint":"^8.56.0","@playwright/test":"^1.28.1","@sveltejs/package":"^2.3.2","eslint-plugin-svelte":"^2.35.1","@sveltejs/adapter-auto":"^3.0.0","eslint-config-prettier":"^9.1.0","prettier-plugin-svelte":"^3.1.2","@sveltejs/adapter-static":"^3.0.1","@sveltejs/vite-plugin-svelte":"^3.0.0","vite-plugin-tailwind-purgecss":"^0.3.3"},"peerDependencies":{"svelte":"^4.0.0","@sveltejs/kit":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/integrity-app_0.1.2_1719362457725_0.9277988850863306","host":"s3://npm-registry-packages"}},"0.1.3":{"name":"@douganderson444/integrity-app","version":"0.1.3","homepage":"https://github.com/DougAnderson444/integrity-app#readme","bugs":{"url":"https://github.com/DougAnderson444/integrity-app","email":"douganderson444+github-integrity-app@gmail.com"},"publishConfig":{"access":"public"},"description":"A SvelteKit app with built-in subresource integrity","license":"MIT","scripts":{"dev":"vite dev","build":"vite build","preview":"vite preview","package":"svelte-kit sync && svelte-package && publint","check":"svelte-kit sync && svelte-check --tsconfig ./jsconfig.json","check:watch":"svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch","test":"npm run test:integration && npm run test:unit","lint":"prettier --check . && eslint .","format":"prettier --write .","test:integration":"playwright test","test:unit":"vitest"},"exports":{".":{"types":"./dist/index.d.ts","svelte":"./dist/index.js"},"./Integrity.svelte":{"types":"./dist/Integrity.svelte.d.ts","svelte":"./dist/Integrity.svelte"},"./Format.svelte":{"types":"./dist/Format.svelte.d.ts","svelte":"./dist/Format.svelte"}},"typesVersions":{">4.0":{"*":["./dist/*"]}},"dependencies":{"@stablelib/base64":"^1.0.1"},"peerDependencies":{"@sveltejs/kit":"^2.0.0","svelte":"^4.0.0"},"devDependencies":{"@playwright/test":"^1.28.1","@sveltejs/adapter-auto":"^3.0.0","@sveltejs/adapter-static":"^3.0.1","@sveltejs/kit":"^2.0.0","@sveltejs/package":"^2.3.2","@sveltejs/vite-plugin-svelte":"^3.0.0","@types/eslint":"^8.56.0","autoprefixer":"^10.4.19","eslint":"^8.56.0","eslint-config-prettier":"^9.1.0","eslint-plugin-svelte":"^2.35.1","postcss":"^8.4.38","prettier":"^3.1.1","prettier-plugin-svelte":"^3.1.2","publint":"^0.2.8","svelte":"^4.2.7","svelte-check":"^3.6.0","tailwindcss":"^3.4.3","typescript":"^5.0.0","vite":"^5.3.1","vite-plugin-tailwind-purgecss":"^0.3.3","vitest":"^1.2.0"},"type":"module","_id":"@douganderson444/integrity-app@0.1.3","gitHead":"95ec33dcd1fed95e1b65c87c799bb5458a8d089f","_nodeVersion":"20.12.2","_npmVersion":"10.8.1","dist":{"integrity":"sha512-zpM9IJSuo/+dSTbWqvsGBGYHBdpvUij5IHf7UMvbkbm4PhnTNEMYmMvgNE7rhkzLP9mqeTTrL3Fu2CQcCBpqJQ==","shasum":"67f96c6925e5ce29b88755cf381ce3392442d995","tarball":"https://registry.npmjs.org/@douganderson444/integrity-app/-/integrity-app-0.1.3.tgz","fileCount":13,"unpackedSize":26864,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICpssEGmwndINMepWiiO3SCEZcDSgIXUsxJqTZf+IyT+AiEAheRxIxWibtQQgZqyfuFqeDNskg0vLLpRvsDsONnX5+E="}]},"_npmUser":{"name":"douganderson444","email":"douganderson444@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/integrity-app_0.1.3_1719365476441_0.6432436450427519"},"_hasShrinkwrap":false}},"time":{"created":"2024-06-25T18:24:39.130Z","modified":"2024-06-26T01:31:16.931Z","0.1.0":"2024-06-25T18:24:39.450Z","0.1.1":"2024-06-25T18:34:46.141Z","0.1.2":"2024-06-26T00:40:57.912Z","0.1.3":"2024-06-26T01:31:16.751Z"},"maintainers":[{"name":"douganderson444","email":"douganderson444@gmail.com"}],"license":"MIT","homepage":"https://github.com/DougAnderson444/integrity-app#readme","bugs":{"url":"https://github.com/DougAnderson444/integrity-app","email":"douganderson444+github-integrity-app@gmail.com"},"readme":"# Integrity Apps\n\n_Always know the code hasn't changed._\n\nBy getting the browser to check the [subresource integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) at the app layer, we can ensure the code is what you expect. \n\n## Use\n\nThe first step is to build your inner app into a single HTML file (index.html) with SRI JavaScript and CSS file(s), this repo includes [a demo of this](./inner-app/) for reference which is built into the [dist](./dist/) folder. \n\nThen, you need to build the outer app, which will load the inner app as long as the SRI hashes match. This functionality is built into, and exported as [Integrity.svelte](./src/lib/Integrity.svelte).\n\nOnce your project is built and hosted, anyone going to the URL will get a data URL to drag or copy into the browser's address bar. This will load the outer app, which will check the integrity of the inner app before loading it.\n\nThen, users just bookmark the data URL and bring that up any time they want to use the site. If they want to upgrade, they just need to refresh the original website and update their bookmarks.\n\n## Developing\n\nStructure:\n\n- [./inner-app/src/App.svelte](./inner-app/src/App.svelte) The inner app that is built and hashed.\n- [./src/lib/Integrity.svelte](./src/lib/Integrity.svelte) The outer app that checks the hash and loads the inner app.\n- [./src/routes/+page.svelte](./src/routes/+page.svelte) Demo use of composing the Components together.\n\nOnce you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), build the [./inner-app](./inner-app/) and start a development server using [just](https://just.systems/man/en/):\n\n```bash\njust dev\n```\n\n## Building\n\nTo create a production version of your app:\n\n```bash\njust build\n```\n\nYou can preview the production build with `npm run preview` or `just preview`.\n\n> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.\n\n## Manual Subresource Integrity\n\nTo manually [generate the SRI](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity#tools_for_generating_sri_hashes) for a file, use openssl:\n\n```bash\ncat static/innerApp.js | openssl dgst -sha256 -binary | openssl base64 -A\n```\n\nTo check the integrity of the app, you can use the `sri` command:\n\n```bash\njust sri\n```\n\n## References\n\nOriginal concept by Robin Linus [Secure Bookmark](https://github.com/coins/secure-bookmark).\n","readmeFilename":"README.md"}