@ogygia/federation

AllMajorMinorPatch Hide pre-releases
0.14.0 minor

@ogygia/federation

Minor Changes

  • #776 702f88f Thanks @PuruVJ! - @ogygia/federation: Breaking: an app checks the signed calls it receives against its audience, or the host of its ORIGIN environment variable when it sets none, and never against the Host the request names. With neither, every signed call gets a 401 and federate() warns federation_audience_missing; set audience (or ORIGIN) on each app that peers call into. verify_signed_request() without audience follows the same rule.
  • #776 702f88f Thanks @PuruVJ! - federation: a signed call also carries one capability token (x-og-cap): method, path, body hash, claims and audience as length-prefixed fields, a nonce that checks once, signed with Ed25519; a receiver checks a call that has one by it alone, and still accepts a call with only the legacy headers (x-og-ts, x-og-n, x-og-sig) from a peer that has not upgraded yet
  • #516 368b1da Thanks @PuruVJ! - - @ogygia/core, ogygia: breaking: SharedState is no longer exported from ogygia or @ogygia/core. Import it from @ogygia/federation/shared instead; it works the same. - @ogygia/federation: SharedState (state shared across separate builds on one page) is exported from @ogygia/federation/shared.

Patch Changes

  • #1001 2a2f7ad Thanks @PuruVJ! - A peer's asset refs are pinned to its origin only in the attribute values of real tags: text on a peer page that looks like one (a code sample, a comment, script text) reaches the shell as the peer wrote it.
  • #1121 d61549f Thanks @PuruVJ! - @ogygia/core: Tag and attribute names read from server HTML are lower-cased the way a browser does it, ASCII letters only, so data-Äsrc and data-äsrc count as two attributes. @ogygia/federation: A peer tag with two attributes whose names differ only past ASCII (data-Äsrc, data-äsrc) now has each value pinned in its own attribute. Before, the first value was written into the second.
  • #1451 032d21f Thanks @PuruVJ! - A request body that breaks off mid-upload is a 400 on the profiler's login and on the federation routes (the exposed table, a thaw notice), not a thrown error and a 500.
  • #1095 b3f4d94 Thanks @PuruVJ! - The region batch endpoint and federation's routes stop reading a request body once it passes their size cap, also when it is sent without a content-length (before, such a body was read whole, then refused).
  • #475 81a40ea Thanks @PuruVJ! - Durations are measured on the monotonic clock: the memory store's TTLs, a federation deploy check's retry wait, the profiler's recording window, deadlines and busy waits, the testing API's wait, and the perf CLI's waits. A wall-clock step no longer moves them.
  • #533 49ff074 Thanks @PuruVJ! - - @ogygia/compiler: new package, ogygia's compiler and its Vite plugin: @ogygia/compiler (the compiler), @ogygia/compiler/vite (ogygia(), definePlugin) and @ogygia/compiler/ids. It uses core only through @ogygia/core/contract; core never depends on it. - @ogygia/core: breaking: the @ogygia/core/vite, @ogygia/core/internal/compiler and @ogygia/core/internal/compiler-ids import paths are gone. Import from ogygia/vite (or @ogygia/compiler/vite), @ogygia/compiler and @ogygia/compiler/ids instead; the names are the same. - @ogygia/core: the types of the ogygia:* virtual modules and the build's switches are named in core (@ogygia/core/contract), so core's own types no longer reach into the compiler. - ogygia: ogygia/vite, ogygia/internal/compiler and ogygia/internal/compiler-ids re-export @ogygia/compiler; apps change nothing. - @ogygia/barrels, @ogygia/cli, @ogygia/content, @ogygia/devtools, @ogygia/federation, @ogygia/flags, @ogygia/postrender, @ogygia/router: they take definePlugin and the compiler from @ogygia/compiler, a new peer dependency (ogygia brings it).
  • #855 db021f1 Thanks @PuruVJ! - @ogygia/federation: a shell's pages allow island code from every peer origin in federate({ peers }), replicas included, so peer islands still wake under core's code-origin check (#851).
  • #703 1865089 Thanks @PuruVJ! - @ogygia/federation: an exposed route table is always asked on the app's own origin. A fragment request whose path does not start with exactly one / answers 400, and search is always the query.
  • #707 d03edda Thanks @PuruVJ! - @ogygia/federation: a deferred remote hole's signature now covers its peer, kind, target and search as separate fields (message version 2). A hole URL minted before the update is refused like any other bad signature; pages rendered after the update carry new ones.
  • #441 352a522 Thanks @PuruVJ! - A peer's redirect target is escaped into the "moved" card's link, so a quote in it no longer breaks the attribute.
  • #1973 cf48d2f Thanks @PuruVJ! - A peer page that is not found is now handled one way: it is a 404 wherever the shell still sets the status, and a slot that can't change its status keeps its fallback. A deferred page hole now answers 404 and keeps its fallback (it used to answer 200 and put the peer's not-found page in the region). A streamed mount({ stream }) now shows the "temporarily unavailable" card (it used to put the peer's not-found page inside the 200). mount() and mount.kit() still answer 404, as before. A peer page that moves with a status that is not a redirect (such as 304) is now refused as a bad answer (a 502, federation_peer_answer_invalid) instead of being passed on as a redirect.
  • #776 702f88f Thanks @PuruVJ! - @ogygia/federation: a signed request's x-og-sig is accepted only as the canonical base64 of its 64 bytes, so every copy of a signature counts as the same one.
  • #441 352a522 Thanks @PuruVJ! - A mounted peer page's title is escaped once: "Tom & Jerry" no longer shows as "Tom & Jerry" in the tab, search results or the error page.
  • #1503 778d273 Thanks @PuruVJ! - A federation request (/og/frag, /og/thaw, /og/fragment/*) that reaches a server before any federate() ran there is now said once as federation_unregistered, instead of a bare 404 with no word.
  • #1457 620d27e Thanks @PuruVJ! - The head's end is found as the browser reads it: an app.html that writes </HEAD> gets ogygia's head injections, and a </head> inside a head script's text (a JSON-LD string) no longer takes them into the script. The body's end is found in any case.
  • #938 f889cbf Thanks @PuruVJ! - A deferred peer region whose peer fails (an error status, a cut or malformed body, or no answer) no longer answers its hole as an empty success: the hole answers 502, 503 or 504, so the region keeps its fallback and the browser asks again.
  • #878 08fd293 Thanks @PuruVJ! - A mounted peer page's head is read as a browser reads it: a title or stylesheet inside a comment is ignored, an unquoted rel counts, and a meta whose quoted content holds > is carried whole instead of cut.
  • #1116 9f7eac5 Thanks @PuruVJ! - @ogygia/core: Reading tags out of server HTML (the head dedupe, region CSS, hole answers, seed injection, stitching) costs 2 to 53% fewer steps: each tag is read once, a character at a time. @ogygia/federation: Lifting a peer page and pinning its asset refs costs about half the steps: one walk, each tag's attributes read once.
  • #930 ad132e5 Thanks @PuruVJ! - A peer answer that is not its JSON document no longer turns the shell's page into a 500: it is said as federation_peer_answer_invalid, a static widget shows its boundary card, and a page read or a mutation is a 502.
  • #1104 e09c8ae Thanks @PuruVJ! - A peer answer that is JSON but not its document's shape ({}, a proxy's {"error":…}, a field of another type) is a failed hop like one that does not parse: federation_peer_answer_invalid is said, a static widget shows its boundary card and a page read is a 502 (before, a TypeError made the shell's page a 500).
  • #932 cd255e1 Thanks @PuruVJ! - A static widget whose peer answers an error status (4xx or 5xx) no longer turns the shell's page into a 500: it shows its boundary card, the answer is said as federation_peer_answer_invalid, and a page read or a post passes the peer's own 503 or 504 through (any other error status is still a 502).
  • #1373 f3fd33c Thanks @PuruVJ! - A peer region's endpoint is re-pointed through the shell however its tag is written (single quotes, no quotes, spaces around =, upper case, after a value holding >), and text that only looks like an endpoint inside another value is left alone.
  • #1750 d780369 Thanks @PuruVJ! - A mounted peer page no longer carries its ogygia-* metas into the shell's head: the peer's router meta turned on the client router in a shell built with router: false, and overrode a shell's own view-transition setting.
  • #2025 7582a45 Thanks @PuruVJ! - A peer page mounted in a shell keeps the context its page set (createContext's setter, ogygia's setContext): it reaches the peer's own islands, scoped to the mounted page.
  • #1821 8684e66 Thanks @PuruVJ! - A page read from a peer whose fetch a thaw or a mutation drops every time no longer fetches forever: after 16 tries it is a 504, said as the new warning federation_peer_read_dropped.
  • #919 9215339 Thanks @PuruVJ! - A server island (or any region with its own endpoint) inside a peer's fragment now shows: the fragment pins its endpoints to its origin, and the shell serves each as a hole of its own that forwards to the peer, instead of asking its own endpoint and getting a 403.
  • #858 8769852 Thanks @PuruVJ! - @ogygia/federation: a peer that serves its island code from its own assets origin (a CDN) wakes on the shell: the shell's page allows the origin of each peer fragment's own runtime, taken only from that peer's answer (#856).
  • #962 b4d8675 Thanks @PuruVJ! - A static widget whose peer gives no answer at all (down, unreachable, or past its timeout) no longer turns the shell's page into a 500: it shows its boundary card, and the failure is said as the new warning federation_peer_unreachable (also for a page read, a post and a deferred region, which answer 504).
  • #1012 26f7e95 Thanks @PuruVJ! - A deferred peer region (and any plugin capability) names the key that signed it, as a region hole does: a server of another deployment (a rolling deploy without one shared OGYGIA_SECRET) refuses it as foreign-key, with the advice that goes with it, instead of as a bad signature.
  • #1470 a13ad32 Thanks @PuruVJ! - A plugin's signed hole (federation's /og/frag) now pays the visitor's region rate budgets as a region hole does: the probe budget before the signature check, the render budget after. A federation hole can now answer 429 with Retry-After under load.
  • #992 edff1c1 Thanks @PuruVJ! - @ogygia/federation: a thaw notice whose id, hop or tags is not the notice's shape is refused with a 400, applies nothing and is passed on to no one (#988).

Updated dependencies: @ogygia/[email protected], @ogygia/[email protected], @ogygia/[email protected], @ogygia/[email protected]

0.13.0 minor

@ogygia/federation

Patch Changes

  • #221 a5d28b0 Thanks @PuruVJ! - The deploy thaw is tried again when its first check fails (the store unreachable, or a peer that never took the notice), instead of being lost until the pages' TTL, and only the peers that missed it are sent it again, for a bounded number of tries (#198).
  • #221 a5d28b0 Thanks @PuruVJ! - After a thaw or a mutation, an old peer request ending no longer removes the newer one, so a read joins it instead of starting another upstream fetch (#210).
  • #175 a99a49a Thanks @PuruVJ! - Every ogygia error and warning has a code and a page at ogygiajs.dev/e/<code>: dev prints the wording and the link, a production build prints the link alone ([ogygia] https://ogygiajs.dev/e/<code>?<args>), so the wording stays out of the client and server bundles.
  • #333 865eb55 Thanks @PuruVJ! - A peer read that starts while a mutation to that peer is out is no longer kept once the mutation ends, so the poster's next read never gets the page from before their own post (#331).
  • #305 e605070 Thanks @PuruVJ! - A thaw drops only the peer documents it names: a fetch already out for another fragment is kept when it lands, and a caller whose fetch a thaw or a mutation made stale reads the page again instead of getting the old one (#294).
  • #323 7a53a56 Thanks @PuruVJ! - A publish's thaw notices go through an outbox handed to the request's waitUntil (the new app.keepAlive), so a serverless instance that freezes after the response no longer loses them and peers no longer keep stale pages until their TTL (#286).
  • #321 17e009a Thanks @PuruVJ! - A peer whose store fails to apply a thaw notice now answers an error, so the sender sends it again, instead of answering done and deduping the retry; app.notify rejects once every hook ran when one failed (#287).
  • #321 17e009a Thanks @PuruVJ! - A thaw notice that a peer never took, after every retry, now prints federation_thaw_notice_failed with the peers that missed it, instead of nothing.
  • #323 7a53a56 Thanks @PuruVJ! - A peer applies two copies of a thaw notice that arrive at once only once, and keeps at most the newest 10 000 notice ids instead of every id for ten minutes (#308).

Updated dependencies: @ogygia/[email protected], @ogygia/[email protected], @ogygia/[email protected]

0.12.0 minor

@ogygia/federation

Patch Changes

  • #157 a217b91 Thanks @PuruVJ! - A remote fragment's island graph (its chunk preloads and portable snippets' locations) is pinned to the remote's origin like its attributes, so the shell no longer resolves it against its own files.

Updated dependencies: @ogygia/[email protected], @ogygia/[email protected]

0.11.0 minor

@ogygia/federation

Patch Changes

  • #83 e229a9a Thanks @PuruVJ! - Remote deferred holes now share local holes' lifetime and renewal: they were signed for a fixed 5 minutes and answered 410 after, so a stored or cached page older than that showed dead remote regions. Plugins sign with core's rule through app.capability.
  • #83 e229a9a Thanks @PuruVJ! - A peer-cache refresh that answers an error no longer replaces the good document it was refreshing.

Updated dependencies: @ogygia/[email protected], @ogygia/[email protected]

0.0.0 minor

@ogygia/federation