@kehto/paja 0.18.1 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -10
- package/dist/browser-host.js +349 -273
- package/dist/browser-host.js.map +1 -1
- package/dist/{chunk-YX6C2UU7.js → chunk-GY5ET3PC.js} +4 -32
- package/dist/chunk-GY5ET3PC.js.map +1 -0
- package/dist/cli.d.ts +2 -1
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/{server-Ia5n1Bqv.d.ts → server-5j5uoy2Z.d.ts} +5 -0
- package/package.json +5 -5
- package/dist/chunk-YX6C2UU7.js.map +0 -1
package/README.md
CHANGED
|
@@ -273,16 +273,31 @@ provides local `ready()`, `supports()`, read-only `services`, and one-shot
|
|
|
273
273
|
`onReady()`. This is the documented upstream-package-drift exception, not a
|
|
274
274
|
shim capability.
|
|
275
275
|
|
|
276
|
-
Before Paja assigns a verified runtime-pointer document to `srcdoc`, it
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
origins
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
276
|
+
Before Paja assigns a verified runtime-pointer document to `srcdoc`, it calls
|
|
277
|
+
`@kehto/shell`'s `prepareNappletSrcdoc`. The shell inserts validated CSP first,
|
|
278
|
+
then the mandatory namespace. Defaults permit inline script/style, WASM byte
|
|
279
|
+
compilation, `data:`/`blob:` images and `data:` fonts, and deny other resource
|
|
280
|
+
classes. Paja grants direct connections only to resolved relay and Blossom
|
|
281
|
+
origins plus explicit host grants.
|
|
282
|
+
|
|
283
|
+
Hosts can pass `csp` to `createPajaRuntimeHostConfig`:
|
|
284
|
+
|
|
285
|
+
```ts
|
|
286
|
+
const config = createPajaRuntimeHostConfig({
|
|
287
|
+
pointer,
|
|
288
|
+
csp: {
|
|
289
|
+
connectOrigins: ['https://api.example'],
|
|
290
|
+
directives: { 'media-src': ['blob:'], 'img-src': ['data:'] },
|
|
291
|
+
},
|
|
292
|
+
});
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
The shell rejects broad JavaScript evaluation, non-origin connection grants,
|
|
296
|
+
and script policies that block its bootstrap. NIP-5D's CSP recommendations are
|
|
297
|
+
enforced; individual baseline source lists remain configurable. Existing
|
|
298
|
+
artifact CSP is retained. Set `frame-ancestors` on the host HTTP response, not
|
|
299
|
+
in a meta policy. See the [shared policy contract](https://github.com/kehto/web/blob/main/docs/policies/NIP-5D-CONFORMANCE.md#shell-csp-enforcement).
|
|
300
|
+
Local target-URL authoring mode retains its separate development policy and HMR.
|
|
286
301
|
|
|
287
302
|
Environment simulation can be supplied through CLI flags or a JSON config file:
|
|
288
303
|
|