Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PROTOCOL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The Dor Tool protocol

> **Status: draft for 0.1.** This is the protocol as Dormouse implements it today. It is not published yet and may change before it is.
> **Status: 0.1.** This is the protocol as Dormouse implements it. It may change before 1.0.

A **Dor Tool** is a command that runs in a terminal and serves a page. A **host** is a terminal that runs the command and shows its page in the same pane. [Dormouse](https://dormouse.sh) is the first host. This document is what a second host, or a Tool written without this repository's packages, needs to agree on.

Expand Down
2 changes: 1 addition & 1 deletion scaffold/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @dor-tools/scaffold

Helpers for building a Dor Tool on [`@dor-tools/api`](../api/README.md): the loopback server that serves a Tool's page under a capability URL, the relay that answers the host's save request through that page, and the page's view of the host's theme. MIT-licensed, depending only on `@dor-tools/api` and Node built-ins. It is private until the protocol reaches 1.0, and its API may change before then.
Helpers for building a Dor Tool on [`@dor-tools/api`](../api/README.md): the loopback server that serves a Tool's page under a capability URL, the relay that answers the host's save request through that page, and the page's view of the host's theme. MIT-licensed, depending only on `@dor-tools/api` and Node built-ins. It is at 0.x, and its API may change before 1.0.

- `@dor-tools/scaffold/server` (Node): `startToolServer`, `announceTool`, the request body readers, file and path helpers, `saveFileOperations`, and `localRealpath`.
- `@dor-tools/scaffold/shared` (Node or a browser): `HttpError`, `responseHeaders`, `pathSegments`, `escapeHtml`, `toolAnnouncement`, and the save relay, `savePages`, with its routes and `pageId`.
Expand Down
3 changes: 2 additions & 1 deletion scaffold/src/loopback-guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const sha256 = (value: string) => createHash('sha256').update(value).digest();
* each request. Host and Origin checks also reject rebinding and foreign scripts.
* See docs/specs/security-local.md -> Local-file viewer. The Host/Origin rule is
* the one `lib/src/host/loopback-guard.ts` states for every loopback listener;
* `dor` cannot import `lib`, so it is restated here with case-insensitive Host comparison.
* this repository builds with nothing of Dormouse's, so it is restated here with
* case-insensitive Host comparison.
*
* `post` admits the built-in viewers' POST routes (the folder's select/activate, the
* editors' save/state/save-poll, the Markdown editor's image/rename), only with an
Expand Down
Loading