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
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ test -d ~/venvs/extenddb-venv && echo "found extenddb-venv in ~/venvs/" || true
Two standard locations:

- `.venv/` at the repo root, created by `scripts/install-linux.sh` and `scripts/install-macos.sh` (recommended).
- `~/venvs/extenddb-venv/`, created by the README instructions.
- `~/venvs/extenddb-venv/`, created by the Python Environment Setup instructions in `docs/manuals/06-developer-test-guide.md`.

Either works. If both exist, prefer `.venv/` since the install scripts maintain it.

Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ jobs:
timeout-minutes: 30
env:
# The wasm-pack release to install; the comment on the wasm tooling
# steps below says why. README.md's "Building it" describes what one
# named wasm-pack release does, so a change of this value needs that
# section checked against the new release, and the release it names
# steps below says why. docs/webassembly.md's "Building it" describes
# what one named wasm-pack release does, so a change of this value needs
# that section checked against the new release, and the release it names
# changed to match.
WASM_PACK_VERSION: "0.15.1"
steps:
Expand Down Expand Up @@ -87,11 +87,11 @@ jobs:
# below, read the description the crate's macros put into the module,
# and both stop with a "different bindgen format" error when that
# description's schema version is not their own; the corpus step's
# wasm-pack needs a wasm-bindgen of that version too (README.md's
# "Building it" says where it looks for one). The cache key holds both
# versions, so a cache hit restores tools of those versions and a miss
# installs them; both land in ~/.cargo/bin, and a hit skips their
# multi-minute compile.
# wasm-pack needs a wasm-bindgen of that version too
# (docs/webassembly.md's "Building it" says where it looks for one). The
# cache key holds both versions, so a cache hit restores tools of those
# versions and a miss installs them; both land in ~/.cargo/bin, and a hit
# skips their multi-minute compile.
- name: Read the wasm-bindgen version from Cargo.lock
id: wasm-bindgen
run: |
Expand Down
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ Expression parsing lives in `crates/core/src/expression/`. This is pure sync Rus
| Cassandra Setup | `docs/cassandra-setup.md` | Cassandra install, config, and deployment (experimental) |
| Testing Design | `docs/design/09-testing.md` | Test strategy and infrastructure |
| Extending Storage | `docs/manuals/12-extending-extenddb-storage.md` | Guide to implementing storage backends |
| Experimental: WebAssembly Build | `docs/webassembly.md` | What the browser build does, refuses and skips; how to build it |

Build PDFs:

Expand Down
858 changes: 177 additions & 681 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion crates/auth/src/sigv4/signing_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use zeroize::Zeroizing;
/// each step, and the tag its backend computes, on the stack;
/// - copies of the key-derived state that the HMAC of each step can leave on
/// the stack, with either backend, and on `wasm32` copies of its key as well
/// (the README at the root of the repository this crate's manifest names,
/// (`docs/webassembly.md` in the repository this crate's manifest names,
/// in its section "What it does not do", says what the `wasm32` backend can
/// leave).
///
Expand Down
11 changes: 6 additions & 5 deletions crates/core/src/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,10 @@ mod imp {
}

pub(super) fn hmac_sha256(key: &[u8], data: &[u8]) -> [u8; 32] {
// HMAC accepts a key of any length, so this never errors. The README
// at the root of the repository this crate's manifest names, in its
// section "What it does not do", says what this leaves on the stack.
// HMAC accepts a key of any length, so this never errors.
// `docs/webassembly.md` in the repository this crate's manifest
// names, in its section "What it does not do", says what this leaves
// on the stack.
let mut mac =
<Hmac<Sha256> as Mac>::new_from_slice(key).expect("HMAC accepts any key length");
mac.update(data);
Expand All @@ -214,7 +215,7 @@ mod imp {
plaintext: &[u8],
aad: &[u8],
) -> Result<Vec<u8>, String> {
// The README at the root of the repository this crate's manifest
// `docs/webassembly.md` in the repository this crate's manifest
// names, in its section "What it does not do", says what this leaves
// on the stack.
let cipher = Aes256Gcm::new_from_slice(key)
Expand Down Expand Up @@ -243,7 +244,7 @@ mod imp {
sealed: &[u8],
aad: &[u8],
) -> Result<Zeroizing<Vec<u8>>, String> {
// The README at the root of the repository this crate's manifest
// `docs/webassembly.md` in the repository this crate's manifest
// names, in its section "What it does not do", says what this leaves
// on the stack.
let (nonce, rest) = split_or_refuse(sealed)?;
Expand Down
8 changes: 4 additions & 4 deletions crates/wasm-adapter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
//! cannot run the HTTP server, which listens on a TCP socket, so in its place
//! JavaScript makes a direct in-process call: it hands a `DynamoDB` request in
//! and gets the response back. The calls skip the server's own checks of a
//! request; the README section "Checks the server makes that this build does
//! not" lists them.
//! request; the `docs/webassembly.md` section "Checks the server makes that
//! this build does not" lists them.
//!
//! # Layout
//! - `runtime` — the portable engine wrapper: builds an `OperationContext`
Expand All @@ -29,8 +29,8 @@
//! under a single fixed account.
//!
//! The module doc of `runtime` says what the adapter does with a request
//! before the engine's handlers see it, and the README section "What it
//! refuses" lists every request the build refuses, with its error.
//! before the engine's handlers see it, and the `docs/webassembly.md` section
//! "What it refuses" lists every request the build refuses, with its error.

mod runtime;

Expand Down
10 changes: 5 additions & 5 deletions crates/wasm-adapter/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
//!
//! On wasm32 the engine and the `SQLite` backend refuse some requests after
//! that, where the code that would serve them is not compiled or cannot run
//! there. The README section "What it refuses" lists every request this build
//! refuses, with its error.
//! there. The `docs/webassembly.md` section "What it refuses" lists every
//! request this build refuses, with its error.
//!
//! # Checks the HTTP server makes that this build does not
//!
Expand All @@ -45,9 +45,9 @@
//! neither for an operation [`unsupported_reason`] names, which it refuses
//! first. A request one of the others would refuse gets the answer
//! this build gives it anyway: the engine handler's for the operation, or one
//! of the refusals above. The README section "Checks the server makes that
//! this build does not" describes the others, with the server's answer and
//! this build's.
//! of the refusals above. The `docs/webassembly.md` section "Checks the server
//! makes that this build does not" describes the others, with the server's
//! answer and this build's.

use std::collections::HashMap;
use std::path::PathBuf;
Expand Down
18 changes: 9 additions & 9 deletions devtools/run-wasm-step
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ case "$step" in
# (the build scripts, the crates they depend on, procedural macros): a
# listed call there (a build script that reads
# std::time::SystemTime::now) fails the step unless an allow covers it.
# --release lints the profile the module ships in: the README and the
# corpus step build it with --release.
# --release lints the profile the module ships in: docs/webassembly.md
# and the corpus step build it with --release.
# CLIPPY_CONF_DIR is set for this cargo only, so other clippy runs
# (clippy.yml's, the pedantic step's) do not read those lists. --lib
# checks the adapter's library alone, which is also what cargo checks
Expand Down Expand Up @@ -351,13 +351,13 @@ case "$step" in
# workflow's tool cache or install step puts one in ~/.cargo/bin).
# --no-opt skips wasm-opt, which the workflow does not install: without
# it, wasm-pack would run a wasm-opt it finds on PATH or in its cache,
# so the module the checks run would depend on the machine. The
# README's "Building it" says how wasm-pack finds or downloads its
# tools, and what else it does, including the `cargo metadata` that
# updates an out-of-date Cargo.lock before the build. Running that
# command first with --locked makes the step stop on such a lock, as
# the build step's `cargo build --locked` does, and leaves the lock as
# it was.
# so the module the checks run would depend on the machine.
# docs/webassembly.md's "Building it" says how wasm-pack finds or
# downloads its tools, and what else it does, including the
# `cargo metadata` that updates an out-of-date Cargo.lock before the
# build. Running that command first with --locked makes the step stop
# on such a lock, as the build step's `cargo build --locked` does, and
# leaves the lock as it was.
if ! command -v wasm-pack >/dev/null 2>&1; then
die "wasm-pack is not on PATH; install the version .github/workflows/wasm.yml installs (cargo install --locked --version <that version> wasm-pack)"
fi
Expand Down
2 changes: 1 addition & 1 deletion docs/adr/0023-catalog-migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ These mechanisms failed in the following ways:
- No test started from a catalog that a released binary created, and no test
compared an upgraded catalog with a fresh one.

v1.0 supports one serving instance per catalog (`README.md:141`). Upgrades
v1.0 supports one serving instance per catalog (`README.md`, "What ExtendDB is not"). Upgrades
have to run in place: `destroy` drops the databases with their items, and
ADR-0003 accepted that only while no deployment depended on a catalog.

Expand Down
2 changes: 2 additions & 0 deletions docs/build-docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@
"docs/manuals/13-event-ticketing-demo.md"),
(19, "backup-and-restore", "Backup and Restore", "usage",
"docs/manuals/14-backup-and-restore.md"),
(20, "webassembly", "Experimental: WebAssembly Build", "reference",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should change. This entry renders the page with Python-Markdown (Markdown==3.10.2 in requirements.txt; the calls at lines 282-285 and 305-308 use the tables, fenced_code and toc extensions) for the PDF and for the console's document page, which embeds that HTML (crates/server/src/console/pages/docs_page.rs:101). Python-Markdown nests a list only when it is indented four spaces, and the five cases under "A synchronous control plane" (docs/webassembly.md:60, 80, 91, 98 and 110) are indented two. In the generated page they become five more top-level items of "What it does not do" ("A new table.", "A write.", "No other state."), which then read as more things the build lacks. GitHub nests them, so the problem shows only in the generated docs. Putting the - of those five items at four spaces (two more than now), with their continuation lines moved the same two, renders correctly in both; adding four spaces instead breaks GitHub's rendering.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6588e33 moves the - of the five cases to four spaces and their continuation lines two further. Python-Markdown 3.10.2 with tables, fenced_code and toc now renders them as a list nested under "A synchronous control plane".

"docs/webassembly.md"),
]


Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ See [Local Development with Docker Compose](local-dev-docker-compose.md).
- Cassandra 4.1+ running locally (see `docs/cassandra-setup.md`)
- Rust toolchain (1.94.0+)
- AWS CLI v2 (for testing)
- Python 3.10+ with virtual environment (see [Python Environment Setup](../README.md#python-environment-setup) in the README)
- Python 3.10+ with virtual environment (see [Python Environment Setup](manuals/06-developer-test-guide.md#python-environment-setup) in the Developer & Test Guide)

## 1. Build extenddb

Expand Down Expand Up @@ -120,7 +120,7 @@ For remote PostgreSQL or Aurora, supply the admin password with `--pg-pass`:
--pg-user postgres --pg-pass <admin-password>
```

When `--pg-pass` is omitted entirely, `extenddb init` connects without a password, relying on
When neither `--pg-pass` nor `EXTENDDB_PG_PASSWORD` is set, `extenddb init` connects without a password, relying on
PostgreSQL peer/ident authentication (works only on localhost via Unix socket).

**Note:** When using Unix socket connections, specify the socket directory with `--pg-host` using an
Expand Down
46 changes: 40 additions & 6 deletions docs/local-mongodb-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,11 @@ mongosh --eval "rs.initiate()"
| Replica set | `rs0` |
| Connection string | `mongodb://localhost:27017/?replicaSet=rs0` |

For Docker on a non-default port:
For the Docker container above, reached from the host, add `directConnection=true`,
because the replica set names its member by the container's hostname, which the
host cannot resolve:
```
mongodb://localhost:27018/?replicaSet=rs0&directConnection=true
mongodb://localhost:27017/?replicaSet=rs0&directConnection=true
```

## Building with MongoDB Support
Expand All @@ -105,8 +107,20 @@ one binary per backend.

## Initializing ExtendDB with MongoDB

On MongoDB, `init` reads the connection string from `extenddb.toml`, so write
that file first, then run `init` with `--overwrite`, which regenerates the file
and keeps the connection string. The `umask 077` creates the file readable by
your user only, as `init` writes it:

```bash
./target/release/extenddb init --backend mongodb --config extenddb.toml
(umask 077 && cat > extenddb.toml) <<'EOF'
[storage]
backend = "mongodb"

[storage.mongodb]
connection_string = "mongodb://localhost:27017/?replicaSet=rs0&directConnection=true"
EOF
./target/release/extenddb init --backend mongodb --config extenddb.toml --overwrite
```

This creates:
Expand All @@ -122,7 +136,7 @@ The generated config will contain:
backend = "mongodb"

[storage.mongodb]
connection_string = "mongodb://localhost:27017/?replicaSet=rs0"
connection_string = "mongodb://localhost:27017/?replicaSet=rs0&directConnection=true"
```

## Starting the Server
Expand All @@ -131,6 +145,22 @@ connection_string = "mongodb://localhost:27017/?replicaSet=rs0"
./target/release/extenddb serve --config extenddb.toml
```

## Creating an Account for Your First Request

On MongoDB, `manage list-accounts` lists no account after `init`, because the
default account `init` writes has no 12-digit account ID. Create an account and
use its ID for the IAM user and access key. With the admin password in
`EXTENDDB_PASSWORD`:

```bash
ACCOUNT_ID=$(./target/release/extenddb manage --user admin \
create-account --account-name dev | grep -o '[0-9]\{12\}' | head -n 1)
```

Then continue with `create-user`, `put-user-policy` and `create-access-key`
as in step 3 of [Make your first request](../README.md#make-your-first-request),
and configure the AWS CLI as in its step 4.

## Config Mapping

```toml
Expand All @@ -155,13 +185,17 @@ export EXTENDDB__STORAGE__MONGODB__CONNECTION_STRING="mongodb://localhost:27017/

## Verifying the Connection

Run these after steps 3 and 4 of
[Make your first request](../README.md#make-your-first-request), which give
the AWS CLI an ExtendDB key and the certificate:

```bash
# Health check
curl --cacert ~/.extenddb/tls/cert.pem https://127.0.0.1:8000/health
curl --cacert ~/.extenddb/tls/cert.pem https://127.0.0.1:18443/health

# List tables (should return empty)
aws dynamodb list-tables \
--endpoint-url https://127.0.0.1:8000 \
--endpoint-url https://127.0.0.1:18443 \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should change. With the port fixed, this reaches the server, but the guide never sets up what the AWS CLI needs here: nothing on the page points it at the self-signed certificate or gives it an ExtendDB key (no AWS_CA_BUNDLE, profile or aws configure), and the account section hands over to step 3 of the README only (lines 159-160), which creates the key but does not configure the CLI. So this does not return an empty list as written. Pointing lines 159-160 at steps 3 and 4 of the README (with a link) and saying that this check runs after them would fix it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

142c751 links step 3 of Make your first request, adds its step 4 for the AWS CLI, and says the connection check runs after those two steps.

--region us-east-1
```

Expand Down
4 changes: 2 additions & 2 deletions docs/manuals/01-architecture-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ Thin binary that wires everything together:

Experimental WebAssembly build of the engine (`publish = false`). It compiles the engine, `storage-sqlite` over an
in-memory database, and the crates they depend on to `wasm32-unknown-unknown`, and exposes a `wasm-bindgen` surface
that answers a DynamoDB request by calling `engine`'s `dispatch` in process, with no server. The README section
"Experimental: WebAssembly build" lists what it does not do and what it refuses.
that answers a DynamoDB request by calling `engine`'s `dispatch` in process, with no server. The page
[Experimental: WebAssembly build](../webassembly.md) lists what it does not do and what it refuses.

## Request Lifecycle

Expand Down
2 changes: 1 addition & 1 deletion docs/manuals/06-developer-test-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ python3 docs/build-docs.py --list
python3 docs/build-docs.py --doc 4
```

If you haven't set up the virtual environment yet, see the [Python Environment Setup](../../README.md#python-environment-setup) section in the README.
If you haven't set up the virtual environment yet, see [Python Environment Setup](#python-environment-setup) above.

Output goes to `pdfs/` (gitignored).

Expand Down
4 changes: 2 additions & 2 deletions docs/rfcs/0000-credential-encryption-key.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ A production deployment must not let a holder of a catalog dump hold both the en
- The credential cache keeps up to 10,000 plaintext secrets and session tokens (section 1). A heap leak, a core dump or swap gives the secret of every active key.
- The only rotation is the manual procedure at `docs/manuals/10-security-model.md:66-70`. The operator replaces the row, restarts every server, then deletes and re-creates every access key. The comment on #707 describes the result as an outage for every signed request until each client has new credentials.

On #228 (2026-08-05), a code owner wrote that the current handling "is probably not sufficient for many production uses". The same review asked for other mechanisms, such as a hardware security module (HSM) or a passcode. ExtendDB runs with no internet connection (`README.md:17`, `docs/manuals/11-deployment-guide.md:148-154`), so no key source may depend on a network key service.
On #228 (2026-08-05), a code owner wrote that the current handling "is probably not sufficient for many production uses". The same review asked for other mechanisms, such as a hardware security module (HSM) or a passcode. ExtendDB runs with no internet connection (the paragraph of `README.md` after its trademark notice, `docs/manuals/11-deployment-guide.md:148-154`), so no key source may depend on a network key service.

## Detailed design

Expand Down Expand Up @@ -402,7 +402,7 @@ PostgreSQL only. The command takes a connection string on standard input, encryp

### 9. Several servers

In 1.0, ExtendDB supports one server per catalog (`README.md:32`). Only SQLite enforces the limit (`docs/manuals/11-deployment-guide.md:302`). The offline commands assume that one server. They run while no server is registered, and the one server loads the new key at its next start. 1.0 does not support more than one server on a catalog. The commands add nothing for it: no reload signal and no poll of the catalog. `rewrap` and `set-data-connection` run beside the running server, because the server reads the ring and the connection string row only at startup.
In 1.0, ExtendDB supports one server per catalog (`README.md`, "What ExtendDB is not"). Only SQLite enforces the limit (`docs/manuals/11-deployment-guide.md`, "Multi-Instance Considerations"). The offline commands assume that one server. They run while no server is registered, and the one server loads the new key at its next start. 1.0 does not support more than one server on a catalog. The commands add nothing for it: no reload signal and no poll of the catalog. `rewrap` and `set-data-connection` run beside the running server, because the server reads the ring and the connection string row only at startup.

### 10. Upgrade and rollback

Expand Down
Loading
Loading