@botiverse/porthole 0.14.5 → 0.14.7

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.
Files changed (76) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/dist/check/page-source.js +1 -1
  3. package/dist/check/page.js +5 -1
  4. package/dist/compile/policy.d.ts +6 -0
  5. package/dist/compile/policy.js +6 -0
  6. package/dist/conformance/entry.d.ts +25 -6
  7. package/dist/conformance/entry.js +69 -18
  8. package/dist/conformance/harness/page.d.ts +12 -0
  9. package/dist/conformance/harness/page.js +95 -51
  10. package/dist/conformance/harness-source.js +1 -1
  11. package/dist/conformance/host-kit.js +39 -13
  12. package/dist/conformance/served.js +148 -0
  13. package/dist/files/paths.d.ts +2 -2
  14. package/dist/files/paths.js +12 -2
  15. package/dist/host/client.d.ts +8 -0
  16. package/dist/host/client.js +47 -17
  17. package/dist/host/create-host.d.ts +10 -0
  18. package/dist/host/create-host.js +124 -10
  19. package/dist/host/door.d.ts +41 -0
  20. package/dist/host/door.js +55 -0
  21. package/dist/host/locate.js +2 -0
  22. package/dist/host/locator.d.ts +55 -3
  23. package/dist/host/locator.js +152 -42
  24. package/dist/host/outcome.d.ts +54 -1
  25. package/dist/host/outcome.js +33 -8
  26. package/dist/host/types.d.ts +10 -2
  27. package/dist/isolation/served.d.ts +1 -1
  28. package/dist/isolation/served.js +35 -0
  29. package/dist/isolation/types.d.ts +20 -2
  30. package/dist/isolation/types.js +2 -0
  31. package/dist/platform/types.d.ts +22 -0
  32. package/dist/platform/web.js +55 -12
  33. package/dist/react/view.d.ts +13 -0
  34. package/dist/react/view.js +101 -2
  35. package/dist/server/files.d.ts +11 -0
  36. package/dist/server/files.js +26 -4
  37. package/dist/server/host.js +106 -28
  38. package/dist/server/index.d.ts +2 -1
  39. package/dist/server/index.js +7 -1
  40. package/dist/server/pages.d.ts +32 -0
  41. package/dist/server/pages.js +82 -6
  42. package/dist/server/server.js +194 -16
  43. package/dist/server/types.d.ts +38 -1
  44. package/dist/transport/post-message.d.ts +1 -9
  45. package/dist/transport/post-message.js +2 -8
  46. package/docs/ADOPTING.md +73 -4
  47. package/docs/DECISIONS.md +245 -0
  48. package/docs/DESIGN.md +24 -18
  49. package/docs/THREAT_MODEL.md +79 -13
  50. package/package.json +1 -1
  51. package/src/check/page.ts +6 -1
  52. package/src/compile/policy.ts +7 -0
  53. package/src/conformance/entry.ts +129 -24
  54. package/src/conformance/harness/page.ts +112 -49
  55. package/src/conformance/host-kit.ts +53 -16
  56. package/src/conformance/served.ts +184 -0
  57. package/src/files/paths.ts +11 -2
  58. package/src/host/client.ts +59 -22
  59. package/src/host/create-host.ts +144 -18
  60. package/src/host/door.ts +97 -0
  61. package/src/host/locate.ts +2 -0
  62. package/src/host/locator.ts +208 -57
  63. package/src/host/outcome.ts +41 -9
  64. package/src/host/types.ts +10 -2
  65. package/src/isolation/served.ts +40 -1
  66. package/src/isolation/types.ts +19 -2
  67. package/src/platform/types.ts +21 -0
  68. package/src/platform/web.ts +55 -20
  69. package/src/react/view.tsx +149 -2
  70. package/src/server/files.ts +37 -5
  71. package/src/server/host.ts +131 -46
  72. package/src/server/index.ts +7 -1
  73. package/src/server/pages.ts +101 -6
  74. package/src/server/server.ts +266 -32
  75. package/src/server/types.ts +41 -1
  76. package/src/transport/post-message.ts +1 -9
package/CHANGELOG.md CHANGED
@@ -4,6 +4,72 @@
4
4
  section); the reasons for every change are in [docs/DECISIONS.md](docs/DECISIONS.md), by the
5
5
  P-numbers below.
6
6
 
7
+ ## 0.14.7
8
+
9
+ - **`server.doorAnswer(instance, grant, request?, at?)` (P126):** the door's answer for a grant a
10
+ host admitted itself, for a host that signs its own tickets and verifies them in its content
11
+ Worker. It returns exactly what `/__porthole/door/<key>` answers after taking its ticket (the same
12
+ `authorize`, document, entry and page checks; `doorResponse` or `doorStatusResponse`, the door's
13
+ CSP, no cookie) and never takes a ticket: call it only for a request you authenticated, with the
14
+ grant you established. `serveDoor` now answers through it, so the two can't drift.
15
+ - **Conformance (P126):** `served.domain.door`'s check (4) swaps the `ticket` parameters between a
16
+ location's own content and door URLs instead of building `/__porthole/d/<key>` from the door
17
+ path, so a host whose door path ends otherwise (`/__porthole/door/_raft`) is judged by its own
18
+ URLs.
19
+
20
+ ## 0.14.6
21
+
22
+ - **Every display ends with an outcome (P125):** a frame started again until its restarts ran out
23
+ is `blocked: error` (it had no outcome at all: an empty box), and restarts no longer start its
24
+ load timeout again — `loadTimeoutMs` covers a loading episode, from its first run until an
25
+ outcome (an outcome or `reload()` begins the next).
26
+ - **Security (P125, after the audit of 2026-10-30):** a served display that isn't nested (a served
27
+ shell, a page, a view through the sandbox proxy) now takes how loading went from a **door** — a
28
+ page of Porthole's on the display's origin, framed hidden and opaque by the host before the
29
+ content, that no same-scope content can reach — not from its own frame. This closes the audit's
30
+ P124-1: a scope's displays share one origin, so a same-scope sibling could reach another
31
+ display's first document before its shell ran and speak Porthole's word for it (a forged sign-in
32
+ with a link out), or silence it into `framing`, or reload it into a run it spoke first in. The
33
+ door decides (`open`, or `blocked` and why); the content frame's own frame status is never taken
34
+ (one `frame-status` host error a run), and its silence is a `timeout`, never a fallback. Nested
35
+ pages, url mode and opaque frames are unchanged.
36
+ - **Server/host contract:** `issue` returns `FrameLocation.door` and `/server` serves
37
+ `/__porthole/door/<key>` for those kinds (`doorResponse`, `doorStatusResponse`, `DOOR_PATH`
38
+ exported for a host's own content Worker). Additive: an old host ignores `door`. A **new** host
39
+ given a served non-nested location **without** a door is strict (no frame status taken, a block
40
+ shows as a timeout) and raises a `hostError` of a new kind `"door"`. **Deploy the server/Worker
41
+ before the host**, and a custom locator must pass `door` through.
42
+ - **A file set's entry must be a page** (P124-2): `checkFileSet`, `admitFiles` and `lintFiles`
43
+ refuse an entry that isn't `.html`/`.htm` (code `entry`); a set stored before this answers
44
+ Porthole's `not-found` status page, and the door says `not-found`.
45
+ - **Before any frame, the host asks `issue`** (P125): blocked or allowed is said by the door or by
46
+ the host's own issue endpoint, never by a frame. A refusal from the frame route is now the
47
+ display's outcome with no frame built: 401 `blocked: sign-in`, 403 `blocked: denied` (with the
48
+ host's code from an optional, additive `error.reason`), 404 `blocked: not-found`, with no
49
+ `locate` host error; any other failure stays `blocked: locate`; a backend that never answers is
50
+ a `timeout`. This holds for every locate.
51
+ - **Migration (no grace release): a clean address is for a top-level tab.** `createHost` refuses
52
+ a served non-nested location without a door before any frame (`blocked: locate`, `door` host
53
+ error), which replaces 0.14.5-P125's "frame it strict and time out" and covers both an old
54
+ server and a clean address framed as it is. To frame what a clean address names, resolve it:
55
+ `client.resolve(address)` or `<PortholeView address>` (the issue endpoint takes `{ address }`
56
+ and answers `{ ...location, instance }`). In a frame the content origin answers a clean address
57
+ (and the app's authorize route answers itself) with a page that has no script and goes nowhere:
58
+ P068's in-frame sign-in page and the transport's host-origin channel (`also`) are removed. A
59
+ locator must issue anew for every run: a reused location's door says `blocked: session`, and
60
+ `createHost` raises a `locate` host error naming the fix.
61
+ - A `PlatformHost` of a host's own must give `createDoor` (delegate to `webPlatform.createDoor`):
62
+ without doors no served non-nested display is framed (`/check`'s own platform now does).
63
+ A refusal maps to an outcome only in the issue endpoint's own shape (`{ error: { code } }`, code
64
+ `unauthenticated`, `forbidden` or `not-found`): a bare 401, 403 or 404 from a proxy stays
65
+ `blocked: locate`. `<PortholeView address>` offers the address as its fallback's tab link only
66
+ on the served content domain, and binds its resolved location to its own first frame.
67
+ - Leak suite: the `door-opaque` control (the door made non-opaque and heard from the content
68
+ origin: a sibling rewrites the live door into Porthole's own status page) and Ferryman's
69
+ `[sibling-reload]` probe (held by `door-status` and `content-status`).
70
+ - Planned, not in this release: a host-only parallel-mount variant (the door and content opened
71
+ together), to be measured against the sequential default.
72
+
7
73
  ## 0.14.5
8
74
 
9
75
  - **Security (P124, after the audit raft-security-audit#16):** any frame could say