Upload Taper: hardened ephemeral E2EE messaging protocol (Matrix hard fork) (part 4)
Browse filesIncludes Taper Room v13 / State Resolution v2.1 server, zero-build vodozemac E2EE web client, Tor-only GTK 4 desktop app, OpenAPI/JSON protocol specification, CycloneDX 1.6 SBOMs, deployment configs, security regression suites, and SEO/HF-optimized README.
This view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- .gitattributes+1
- docs/platforms.mdAdded+98
- docs/release-checklist.mdAdded+97
- docs/reproducible-builds.mdAdded+76
- docs/security-updates.mdAdded+210
- docs/spec-site.mdAdded+114
- docs/threat-model.mdAdded+425
- docs/user-guide.mdAdded+412
- go.modAdded+5
- go.sumAdded+4
- informal/idp-brands.mdAdded+67
- layouts/404.htmlAdded+8
- layouts/_markup/render-heading.htmlAdded+11
- layouts/_markup/render-passthrough.htmlAdded+11
- layouts/_partials/added-in.htmlAdded+13
- layouts/_partials/alert.htmlAdded+20
- layouts/_partials/breadcrumb.htmlAdded+35
- layouts/_partials/changed-in.htmlAdded+11
- layouts/_partials/endpoints-toc.htmlAdded+61
- layouts/_partials/events/example.htmlAdded+16
- layouts/_partials/events/render-event.htmlAdded+108
- layouts/_partials/favicons.htmlAdded+11
- layouts/_partials/footer/center.htmlAdded+30
- layouts/_partials/head-css.htmlAdded+38
- layouts/_partials/hooks/body-end.htmlAdded+17
- layouts/_partials/hooks/head-end.htmlAdded+18
- layouts/_partials/json-schema/resolve-additional-types.htmlAdded+251
- layouts/_partials/json-schema/resolve-allof.htmlAdded+89
- layouts/_partials/json-schema/resolve-examples.htmlAdded+71
- layouts/_partials/json-schema/resolve-refs.htmlAdded+87
- layouts/_partials/navbar-version-selector.htmlAdded+18
- layouts/_partials/navbar.htmlAdded+102
- layouts/_partials/openapi/render-api.htmlAdded+59
- layouts/_partials/openapi/render-content-type.htmlAdded+37
- layouts/_partials/openapi/render-media-type-objects.htmlAdded+104
- layouts/_partials/openapi/render-object-table.htmlAdded+342
- layouts/_partials/openapi/render-operation.htmlAdded+120
- layouts/_partials/openapi/render-parameters.htmlAdded+35
- layouts/_partials/openapi/render-request.htmlAdded+42
- layouts/_partials/openapi/render-responses.htmlAdded+64
- layouts/_partials/render-example.htmlAdded+40
- layouts/_partials/search-input.htmlAdded+10
- layouts/_partials/sidebar-tree.htmlAdded+194
- layouts/_partials/spec-content.htmlAdded+14
- layouts/_partials/toc.htmlAdded+29
- layouts/_partials/version-banner.htmlAdded+22
- layouts/_shortcodes/added-in.htmlAdded+9
- layouts/_shortcodes/boxes/note.htmlAdded+1
- layouts/_shortcodes/boxes/rationale.htmlAdded+1
- layouts/_shortcodes/boxes/warning.htmlAdded+1
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines3334353632 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textstatic/fonts/Inter-latin-ext-normal.woff2 filter=lfs diff=lfs merge=lfs -text
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798# Platforms
**Supported:** GNU/Linux, with the [desktop app](../desktop/README.md), andthe web client hosted by a server (in Tor Browser at the Standard securitylevel, or any modern browser).
**Planned, not supported:** everything below. There are no test machines forthese platforms yet, so nothing here has been built or tested. This pagerecords the intended approach, so that work started later fits the rest ofTaper.
## The common design
Every app follows the same pattern as the Linux desktop app:
- **A thin native shell around the same bundled web client.** The cryptography lives only in that client (vodozemac with the Matrix Rust SDK's crypto state machine, and opaque-ke, as WebAssembly). Shells never reimplement it, and never load client code from a server.- **Tor built in.** The shell runs Tor, or uses the system's Tor, and routes every connection through it, with host names resolved by Tor.- **A locked-down web view:** no navigation away from the bundled client, no new windows, no developer tools, no WebRTC, every permission refused.- **Signed releases**, once they exist (see the [proposal](design/signed-releases.md)).
The web view must support WebAssembly, WebCrypto in a secure context, andIndexedDB, and must send `.onion` names to the proxy rather than to DNS. Eachplatform's shell needs a test like `desktop/test_desktop.py` that checksthese points.
## Tor on mobile: Arti
**Decided:** the Android and iOS apps embed **Arti**, the Tor Project'sRust implementation of Tor. Reasons:
- It's built to be embedded as a library, which the C `tor` isn't.- Rust removes the memory-safety bugs that come with C.- The Tor Project is moving its own work to it.
The app runs Arti in-process and points its web view at Arti's local SOCKSport, exactly as the desktop app does with its private `tor`.
Bridges work the same way as on the desktop (WebTunnel, obfs4, Snowflake),with one difference: iOS doesn't let apps start other programs. Thetransports must therefore run inside the app, for example through IPtProxy,the library that packages lyrebird and Snowflake for Orbot and OnionBrowser.
Before building, check that the Arti release in use supports what Taperneeds as a client: connecting to onion services, bridges with pluggabletransports, and stream isolation.
**Not changing:** servers and the Linux desktop app stay on C `tor` for now.C `tor` hosts onion services with mature defences, including proof-of-workagainst introduction floods, and it comes from the distribution with itssecurity updates. Revisit once Arti matches it for hosting onion services.
## Windows (planned)
WebKitGTK doesn't support Windows, so the GTK shell can't simply bereused. The likely shell is a small native app around Microsoft's WebView2(Chromium-based), with Tor's Windows expert bundle. Open questions: shippingand updating Tor, and signing builds so that Windows' SmartScreen acceptsthem.
## macOS (planned)
A Swift shell around WKWebView, the macOS equivalent of the iOS app below,is more natural than GTK on macOS. Tor would be bundled. Distributing outsidethe App Store still needs Apple's notarization, or users must overrideGatekeeper.
## Android (planned)
A Kotlin shell around Android's WebView, which supports WebAssembly, withArti embedded (see above). Distributed through F-Droid and as a signed APK, notGoogle Play first. Android may stop background connections, so offlinedevices rely on push notifications, which carry only event IDs (see the PushGateway API).
## iOS (planned, unofficial)
There will be no App Store app. The plan is a Swift shell around WKWebView,with Arti embedded (see above). Things to know:
- **Building needs a Mac** with Xcode.- **Installing without the App Store:** AltStore or SideStore (an app signed with a free Apple ID has to be re-signed every 7 days), or, in the EU, an alternative app marketplace (Apple still has to notarize the app).- **Lockdown Mode probably breaks it.** Apple's Lockdown Mode is believed to turn off WebAssembly in web views, as Tor Browser's Safer level does. The people most likely to use Lockdown Mode are the ones Taper is for. This needs checking on a device before any work starts. If it's true, iOS needs a client whose cryptography is native code (the Matrix Rust SDK's Swift bindings, and opaque-ke compiled for iOS), which is a much larger project.- iOS suspends apps in the background, so delivery to closed apps depends on push notifications, which carry only event IDs.12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697# Release checklist for a public 1.0
**Status:** working list. Statuses were set on 2026-11-23 from the repositoryat commit `ea7af0dd` on branch `taper/rebrand-and-retention`, with theuncommitted changes in the working tree (among them `server/test-fuzz.js`).
Taper has no GitHub CI. The local gate (`scripts/ci/gate.sh`) is the CI, so"passes the gate" is one of the checks for every code item below.
Status values:
- **done**: it exists and has been checked.- **partly**: some of it exists. The row says what is missing.- **not started**: nothing exists.- **needs a human**: only a person outside the code can do it (a key, a lawyer, an outside reviewer, a decision).
Security keys, persistent devices, room-key backup, password change,account deletion, the admin command line and the update notice now exist.Their rows below were checked against the code and name the test that coverseach. A test can only show what it exercises: where a row says "no test", thebehaviour is in the code but nothing proves it stays.
Owners are placeholders: [OWNER].
## Safety-critical features
| Item | Status | Owner | How we'll know ||------|--------|-------|----------------|| Persistent devices ("keep this device signed in", device passphrase, Lock, Wipe) | done, apart from the idle auto-lock (own row). `client/device.js` and `client/account.js`. The default stays "nothing survives closing the tab". On the desktop the web view's storage is ephemeral unless the user ran `taper-desktop --keep-data` once. Wipe from the lock screen can't revoke the token on the server (the token is still sealed), so it lapses after 7 days | [OWNER] | Covered by `client/test-browser.mjs` ("a device that stays signed in": sealed on disk, wrong passphrase refused, Lock, Wipe leaves no crypto store) and by `desktop/test_desktop.py` (the keep-data flag, private directories, forget-data). No test that a real desktop run leaves nothing on disk by default || Dead man's switch (command, quorum, dead hand, duress) | done in code; needs a lawyer and a drill. `server/dms.js`, documented in [dead-mans-switch.md](dead-mans-switch.md) | [OWNER] | `server/test-dms.js` wipes a real server in each mode and checks a prior backup can't be decrypted. Still needed: legal review of the duress and dead-hand modes, and a drill on a real deployment with the systemd unit (`admin.js drill` shows nothing in `cannot_destroy`) || Idle auto-lock | done. Kept devices auto-lock after a configurable idle time (default 15 minutes, adjustable in Settings → This device). `client/account.js` | [OWNER] | Covered by `client/test-browser.mjs` || Room-key backup (key from the password; parts named for the UTC upload day, expire 21 days after that day starts) | done. Server: `t.backup.put`, `get` and `clear` in `server/index.js`. Client: `client/account.js`. On by default; the user can turn it off in Settings | [OWNER] | `server/test-webauthn.js` ("key backup": today's or yesterday's day only, opaque blob, nobody else sees it, clear) and `client/test-browser.mjs` ("a new browser reads old messages from the room-key backup"). **No test** that a part is dropped 21 days after its day, or of the 512 KiB, 200-part and 8 MiB limits || Password change that signs out other devices | done. `t.password.change.start` and `finish` in `server/index.js`; the form is in Settings | [OWNER] | `server/test-webauthn.js` (old password stops working, new one works, other devices signed out, a change without the re-sealed identity is refused, a key touch is needed when the account has keys) and `client/test-browser.mjs` (identity and backup survive) || Account deletion | done. `t.account.delete` (and `admin.js delete`) removes the account and what hangs on it; the user ID is kept, with the time, so nobody can register it again | [OWNER] | `server/test-webauthn.js` ("deleting an account removes it, and the name stays reserved") and `server/test-admin.js`. No browser test of the Delete button || Security keys (FIDO2/WebAuthn) and the opt-in badge | done in code: at most 8 keys per account, step-up for the sensitive actions, optional key at login, an opt-in badge shown to people who share a room. `server/webauthn.js`, `client/webauthn.js`, `client/account.js`. The UI text and the specification say the badge is not proof of a human | [OWNER] | `server/test-webauthn.js` (a software authenticator, `server/softkey.js`: attestation, wrong origin, replay, cloned counter, two-step login, the badge) and `client/test-browser.mjs` (Chromium's virtual authenticator). **Only those two have been used.** A real YubiKey has not (own row) || Attestation roots | needs a human (an operator task). The server ships **no** roots: `TAPER_WEBAUTHN_ROOTS` is empty by default, so every key is "unattested" until an operator installs roots they trust | [OWNER] | `deploy/README.md` says how to get and install roots; at least one real attested registration is recorded || Megolm or MLS | needs a human: the project owner's decision, undecided. `content/security.md` currently keeps Megolm and sets out the research | [OWNER: project owner] | A written decision in `docs/design/`, and the spec and client agree with it || Format versioning: secrets blobs, backup blobs, store schema | partly. The identity blob is `t.secrets.v1.aes-gcm`, the backup blob `t.backup.v1.aes-gcm`, OPAQUE is `taper-opaque-v1`, rooms are version 13, and the device record has `v: 1`. The SQLite store carries `PRAGMA user_version = 1`, and an older server refuses a newer database (`server/store.js`). Nothing migrates an old database yet | [OWNER] | `server/test.js` ("a database written by a newer format is refused") covers the refusal. Still needed: a test that opens a fixture written at format 1, once a format 2 exists || Federation labelled experimental | partly. The docs list the gaps (no state resolution, no cross-server media), `deploy/README.md` says it is experimental, and the server prints a warning at start-up when peers are configured (uncommitted at the time of writing). Nothing in the spec or the client says it | [OWNER] | A line in the spec, in `deploy/README.md`, and at server start-up when peers are configured || A real UI | not started. The desktop app and the web client are still the development web client, with a "Development client" banner | [OWNER] | A designed client replaces it; the banner is gone; the browser test and the desktop test pass against it || Accessibility | not started as an audit. The dev client has some ARIA attributes (live regions, a dialog role, labels on inputs), and Escape closes the settings dialog (uncommitted at the time of writing). Nobody has tested it with a screen reader | [OWNER] | Keyboard-only and screen-reader pass on login, rooms, verification and the new security screens; findings fixed or listed || Operator moderation tools | partly. `server/admin.js`, over `TAPER_ADMIN_SOCKET` (mode 0600): `users`, `stats`, `suspend`, `unsuspend`, `revoke`, `unlock`, `delete` and `limits` (`registration_open`, `register_pow_bits`, `rate_burst`, `rate_per_sec`, `budget_scale`; these change live and are not kept across a restart). Suspensions are stored. The log names the action, never the account. There are no power levels, bans or kicks (`server/README.md`, "Not here yet") | [OWNER] | `server/test-admin.js` covers every command. `deploy/README.md` says how to use it. Still open: an operator who has not seen the code does it from the guide alone |
## Releases and trust
| Item | Status | Owner | How we'll know ||------|--------|-------|----------------|| Signed releases | not started: `docs/design/signed-releases.md` is a proposal and its open questions are unanswered | [OWNER] | A release has a manifest signed by at least two maintainer keys, and a documented check, e.g. `taper-verify`, accepts it || SHA-256 sums published with each release | partly: `scripts/release/build.sh` writes `SHA256SUMS-VERSION`. Not yet signed or published | [OWNER] | A `SHA256SUMS` file, signed, beside every release artifact || At least two maintainers with release-signing keys | needs a human. All 85 commits on the branch are from one author. `SECURITY.md`, `docs/security-updates.md` and `docs/legal.md` all have `[MAINTAINERS: ...]` placeholders that wait for a second person | [OWNER] | Two public key fingerprints in `SECURITY.md` and in the signed-releases design, each held by a different person || Reproducible builds | partly: the server, desktop and source tarballs rebuild bit for bit (`scripts/release/verify-reproducible.sh`, [reproducible-builds.md](reproducible-builds.md)), checked on one machine. The container image isn't reproducible | [OWNER] | Two people build the same commit and get the same bytes || Update notification | partly. Desktop only: `desktop/taper_desktop/updates.py`. When a packager provides `update-url` and `release-key` beside the code (or `TAPER_UPDATE_URL` and `TAPER_UPDATE_KEY`), the app fetches `latest.json` and `latest.json.sig` over Tor, checks the Ed25519 signature (needs `python3-cryptography`; without it no notice is shown), shows a banner and never installs. `TAPER_NO_UPDATE_CHECK=1` or `~/.config/taper/no-update-check` turns it off. The web client has no update check | [OWNER] | `desktop/test_desktop.py` covers a valid note, a bad signature, a bad version, an older version, the opt-out, and a run where the only destinations are the onion service and the release host. Missing: the release address and signing key (own row) || Update-notice release address and signing key | needs a human. No release address exists and no signing key has been made, so every build is off | [OWNER] | A key made and held offline by a person, its public half in the packaged `release-key`, a published `update-url`, and one real signed `latest.json` fetched over Tor by a packaged build || Security-update fast path | partly: [`security-updates.md`](security-updates.md) is written. It needs two maintainers to adopt it | [OWNER] | Maintainers sign off the document; a practice run ships a dummy update in the time the document promises || Compromised-key plans | partly: `docs/design/compromised-keys.md` is written and covers the server signing key, the onion key, TLS, the gateway and federation paths, a seized device, the identity key, the key directory and the OPAQUE secret. It has no section for release-signing keys or the update-note key, because neither exists yet. Nothing in it has been drilled | [OWNER] | The document covers release keys and the update-note key once they exist, and each has a drill || Merge the branch into `main` and tag | not started. The branch is 85 commits ahead of `main`. The tags in the repository (`v1.x`) are upstream's, so there is no Taper tag | [OWNER] | `main` holds the 1.0 commit and a signed tag exists || Change the `origin` remote and host the release | needs a human. `git remote -v` shows `origin` still pointing at `https://github.com/matrix-org/matrix-spec.git`, the upstream spec repository, for fetch and push. Taper doesn't use GitHub. Hugging Face is the preferred host. A human has to choose the host and change the remote | [OWNER] | The release and the source are served from the chosen host, and nothing in the docs points to GitHub for Taper itself || Full local gate on a release machine, with nothing skipped | partly. The gate skips the browser test without Chromium, the desktop test without Xvfb and GTK, the live Tor test unless `TAPER_LIVE_TOR=1`, and the vulnerability scan offline | [OWNER] | A release log shows `PASS` for every step and `TAPER_LIVE_TOR=1` was set. The pre-push hook can be bypassed with `--no-verify`, so the log is the record |
## Security assurance
| Item | Status | Owner | How we'll know ||------|--------|-------|----------------|| Threat-model page | partly: `docs/threat-model.md` is written and was checked against the code on 2026-11-23. It is linked from `docs/README.md` and the user guide, but not from the root `README.md`, and nobody outside the project has read it | [OWNER] | The page exists, says what Taper doesn't protect against, and is linked from the user guide and `README.md` || `SECURITY.md` with an OpenPGP key | needs a human. `SECURITY.md` is drafted (untracked) and says plainly that no key and no contact exist. A person must make the key and fill in the contact, and a lawyer must review the safe-harbor section | [OWNER] | The file is in the repository, the key's fingerprint is also published somewhere other than the repository, and a test message is decrypted by the maintainers || Independent security review | needs a human. Nobody outside the project has reviewed the server, the client glue code or the desktop shell | [OWNER] | A written report, with findings fixed or accepted in public || Fuzzing of the gateway and federation parsers | partly. `server/test-fuzz.js` (untracked, not yet in `npm test` or the gate) sends hostile input to every method and to the frame and federation parsers, with a replayable seed. It is a randomised test, not a coverage-guided fuzzer, and doesn't reach the WebAssembly libraries. The server checks the exact size of every OPAQUE message before it reaches the library | [OWNER] | Fuzz targets for the frame parser, the federation transaction parser and the media chunk parser run for a stated time with no crashes; the harness is in the repository || Written no-telemetry promise | not started. A search of `client/`, `server/index.js` and `desktop/` for telemetry or analytics code finds none, but nothing promises it | [OWNER] | A short statement in `README.md` and the user guide, a test that the client makes no requests except to its gateway, and the update check being the only other request || SBOM gap: Rust crates inside the WebAssembly libraries | not started. Documented in `DEPENDENCIES.md`; `grype` can't scan those crates | [OWNER] | The crates from `Cargo.lock` of each library release appear as components in the SBOMs, and `grype` runs on them || 14-day rule actually enforced | partly. It is only policy: stated in `DEPENDENCIES.md` and in comments in `scripts/requirements.txt` and `scripts/sbom/requirements.txt`. No gate step checks it | [OWNER] | A gate step fails when a pinned release is under 14 days old, with an exception for the security fast path || Known issues in `DEPENDENCIES.md` cleared | partly. Three Medium findings in build tooling (Hugo, `@redocly/cli`, `glob`/`minimatch`) remain | [OWNER] | The table in `DEPENDENCIES.md` is empty, or each entry has a dated reason || Retention gaps left on the server | done for local & federated validation. `purgeExpired` drops expired tokens, orphaned device keys, expired `leave` membership state and empty rooms, and runs a WAL truncation checkpoint. Both `verifyRemoteEvent` and `remoteJoin` check timestamps, signatures, `t.room.create` hashes and Room v13 auth rules, and `t.room.retention` enforces per-room shorter lifetimes. A peer can still keep what it receives (documented) | [OWNER] | Covered by `server/test.js`, `server/test-state-res.js` and `server/test-federation.js` || Fixed OPAQUE library issue | partly. `@serenity-kit/opaque` 1.1.0 can be pushed into a broken state by malformed input; the server works around it by checking sizes and encodings | [OWNER] | Upstream fix adopted, or the workaround covered by a test and a fuzz target |
## Testing on real platforms and networks
| Item | Status | Owner | How we'll know ||------|--------|-------|----------------|| Real WebTunnel bridge test | needs a human, to get real bridge lines. A real Tor already runs lyrebird for a WebTunnel line offline (`desktop/test_desktop.py`). The live test passed through Snowflake, and through lyrebird reading lines from a file, on 2026-11-23, but not through a working WebTunnel bridge | [OWNER] | A recorded live run connects through a real WebTunnel bridge, from a network that blocks Tor relays || Real-device test of a hardware security key (YubiKey) | needs a human with a key. Registration, touch, login and the `unattested` level have been run only against a software authenticator (`server/softkey.js`) and Chromium's virtual authenticator. Nothing has been tried with real hardware, a platform key, Tor Browser or the desktop app's web view | [OWNER] | A recorded run with a real YubiKey (and a platform key) in Tor Browser and in the desktop app: add, remove, step-up, required at login || Tails testing | partly. The code path is written but untested (`desktop/README.md`) | [OWNER] | A recorded session on Tails: the app uses the system Tor and nothing is written to disk || Flatpak packaging | not started | [OWNER] | A Flatpak builds from the repository, runs with a sandbox that allows only what the app needs, and passes the desktop test || Closed beta | partly: the plan is in [`closed-beta.md`](closed-beta.md); no beta has run | [OWNER] | The exit criteria in that document are met |
## Documentation and people
| Item | Status | Owner | How we'll know ||------|--------|-------|----------------|| User guide | partly: [`user-guide.md`](user-guide.md) is drafted and its button names were checked against `client/index.html` on 2026-11-23. A non-technical person hasn't read it, and there are screens it doesn't describe yet | [OWNER] | Two people who aren't developers finish the tasks in it without help || Operator guide matches the release | partly. `deploy/README.md` now covers the admin command line, security keys and attestation roots, and what a backup holds. It has not been followed by someone who hasn't seen the code, and `deploy/Containerfile` doesn't copy `server/webauthn.js` or `server/admin.js` (so the container does not start) | [OWNER] | An operator who hasn't seen the code can set up, back up, restore and suspend an account from the guide alone || Legal checks | needs a human: a lawyer. [`legal.md`](legal.md) lists the questions | [OWNER] | A lawyer's written answers, or a written decision to proceed without them || Clean up the Matrix name and attribution | partly. A `NOTICE` exists, and the author in `package.json`, the site footer and the "Taper 1.0" link in `content/_index.md` were fixed. See the lists in `legal.md` for the rest: `package.json` still has the name "matrix-spec" and GitHub URLs, the root `README.md` still links to upstream, and so on | [OWNER] | `legal.md`'s list is empty or each item is deliberate || Contributor sign-off enforced | not started. `CONTRIBUTING.rst` asks for a DCO sign-off, but the commit hook (`.githooks/commit-msg`) checks only the Conventional Commit format, and none of the branch's commits have a `Signed-off-by` line | [OWNER] | The `commit-msg` hook rejects a commit without `Signed-off-by`, or the project chooses a different rule || Operator backup and restore tested | not started. `deploy/README.md` describes the two directories and what a restore loses, but no test restores from a backup | [OWNER] | A script restores `data` and `opaque.secret` onto a clean host, logins work, and the old daily keys are not needed || Password policy decided | partly. The sign-in and change-password forms ask for at least 8 characters (`client/index.html`). The server enforces no minimum, and under OPAQUE it never sees the password, so it can't check strength either; anything that skips the form (another client) can register a one-character password | [OWNER] | The client shows a strength check or a longer minimum, and the user guide matches || Deniability claim tested against the final design | needs a human. `content/security.md` says deniability rests mainly on removing signatures from content, and says no deployed system offers it with strong group security | [OWNER] | The claim in the threat model matches what a reviewer concludes about the final message format |12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576# Reproducible builds
Anyone can rebuild a Taper release from its source and get **the same bytes**we published. If a release doesn't rebuild to the published checksums,don't trust it: something was added between the source and the release.
## What a release contains
`scripts/release/build.sh` makes these, in `dist/`:
| Artifact | Contents ||----------|----------|| `taper-server-VERSION.tar.gz` | The server, its locked production dependencies, the web client it serves, deployment files, its SBOM || `taper-desktop-VERSION.tar.gz` | The desktop app, the bundled web client, the installer, its SBOM || `taper-source-VERSION.tar.gz` | The source tree exactly as committed || `SHA256SUMS-VERSION` | SHA-256 of each of the above |
`VERSION` comes from `git describe`: the Taper tag for a release(`taper-v1.0.0`), otherwise the nearest Taper tag plus the commit hash, orjust the hash if there is no Taper tag yet. The repository's `v1.x` tags areupstream Matrix's and are ignored.
## Building and checking a release
You need git, GNU tar, gzip, Python 3, Node.js and npm, plus network accessfor the dependencies (or a warm npm cache).
```shgit checkout taper-v1.0.0scripts/release/build.sh # builds into dist/scripts/release/verify-reproducible.sh # builds twice and comparesscripts/release/verify-reproducible.sh taper-v1.0.0 SHA256SUMS-taper-v1.0.0 # also compares with what was published```
`verify-reproducible.sh` builds the commit twice: from differentdirectories, under different umasks (022 and 077), time zones (UTC andAsia/Shanghai) and locales. It fails unless every artifact is identical.
## How the build is made reproducible
| Source of difference | What the build does ||----------------------|---------------------|| Uncommitted or ignored files | Builds from `git archive` of the commit, never the working tree || Dependency versions | `npm ci` from the committed lockfiles, which pin each package by integrity hash || Code run by dependencies at install | `npm ci --ignore-scripts`: none of the dependencies need install scripts || npm's bookkeeping | `node_modules/.package-lock.json` is removed || Python bytecode | Never written (`python3 -B`); none is shipped || File order | `tar --sort=name`, with input lists sorted under `LC_ALL=C` || Timestamps | Every file's time is the commit time (`SOURCE_DATE_EPOCH`); atime and ctime are left out; `gzip -n` stores no name or time || Owners | `--owner=0 --group=0 --numeric-owner` || Permissions | Normalized to `644`, or `755` for executables, whatever the builder's umask || Time zone and locale | `TZ=UTC`, `LC_ALL=C` |
There are no native modules: the cryptography is WebAssembly, shippedpre-built inside the npm packages and pinned by the lockfile's integrityhashes. The npm packages themselves are the upstream builds. Reproducing*those* from source is up to their projects (see [DEPENDENCIES.md](../DEPENDENCIES.md)).
## What isn't covered yet
- **The container image.** `deploy/Containerfile` pins its base image by digest, but image builds add layer timestamps and metadata. Until it is made reproducible, build the image yourself from a checked tarball rather than pulling one.- **Signatures.** Checksums prove two builds match, not who made them. Signing releases is proposed in [design/signed-releases.md](design/signed-releases.md).- **Toolchain versions.** The output doesn't depend on the Node.js or npm version as far as we have tested, but builds have only been compared on one GNU/Linux distribution. Report any difference you find as a bug.
## SBOMs
Each artifact ships the CycloneDX SBOM for what it contains (from `sbom/`).`scripts/sbom/generate.py` produces them from the lockfiles, and the CI gatefails if they are out of date (`scripts/sbom/generate.py --check`).123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210# Security updates: the fast path
**Status:** proposal for the maintainers to adopt. Written 2026-11-23.
Taper normally waits before adopting a new dependency release, because newreleases are where supply-chain attacks land. That wait is wrong when therelease fixes a known flaw that puts users at risk. This document describesthe exception: when it applies, what must be shown, who decides, what muststill pass, and how we tell people.
## The 14-day rule, and how it is enforced today
The rule is rule 3 in [`DEPENDENCIES.md`](../DEPENDENCIES.md): "No releaseunder 14 days old." It says to use `npm install --before=<date>` for npmpackages, and to hold Python packages back with `pip-compile -Pname==previous`. Comments in `scripts/requirements.txt` and`scripts/sbom/requirements.txt` repeat it.
**It is only a policy.** Nothing enforces it:
- There is no `.npmrc` setting, no `min-release-age` option and no `--before` in any script.- The local gate (`scripts/ci/gate.sh` and `scripts/ci/gate.d/sbom.sh`) has no step that checks a dependency's release date. The SBOM check confirms that the SBOMs are current and that `DEPENDENCIES.md` lists every direct dependency. It doesn't look at ages.- What does protect against a bad new release is exact pinning with integrity hashes (npm lockfiles, `pip install --require-hashes`, `go.sum`), and the Containerfile pinning the Node image by digest. Those stop a *silent* change. They don't stop us from choosing a new, bad version.
So the exception below is a rule people follow, not a switch in the gate. The[release checklist](release-checklist.md) has a row for making the gate checkthe rule, with the exception recorded in `DEPENDENCIES.md`.
## What the rule covers, and what it doesn't
The 14-day rule applies to what Taper chooses and pins: npm packages, Pythonpackages, Go modules and the Node base image. It doesn't apply to software theuser or operator installs from their distribution (the desktop app has noPython packages of its own; see `DEPENDENCIES.md`). For those, thedistribution's security channel decides the version. What Taper can do forthem is tell people to update.
## Which dependencies qualify
The fast path is for software that ships to users, runs on a server, or readsdata from outside. Build and test tools don't qualify. They go through thenormal rule.
| Dependency | How we get it | What a fix means ||---|---|---|| **WebKitGTK** (`gir1.2-webkit-6.0`) | The user's distribution | We can't ship it. Update the tested version in `DEPENDENCIES.md` and `desktop/README.md`, and tell users to update their system || **Tor** (`tor`) | The user's or operator's distribution | Same. Also tell operators who run onion services || **lyrebird** and **snowflake-client** | The distribution | Same || **Node.js, including its bundled OpenSSL** | The operator: system Node, or the pinned image in `deploy/Containerfile` | Bump the image digest in the Containerfile and the SBOM. Tell systemd operators to update Node || **Crypto WebAssembly libraries**: `@matrix-org/matrix-sdk-crypto-wasm` (vodozemac and the Rust SDK's crypto) | npm, exactly pinned in `client/package-lock.json` | A new pinned version, shipped in the web client and the desktop bundle || **OPAQUE library**: `@serenity-kit/opaque` (opaque-ke) | npm, used by the client and the server | A new pinned version in both || **`ws`**, the server's WebSocket library | npm | A new pinned version |
Not covered here: ESLint, Playwright, Hugo, `@redocly/cli`, PostCSS and thePython tooling. They never reach users. Their fixes follow the normal rule.
## What evidence is required
An exception needs all of these, written down in the change (the commitmessage and the new row in `DEPENDENCIES.md`):
1. **An identifier from someone else.** A CVE, a GHSA, a RUSTSEC entry, a distribution advisory (DSA, USN), a Tor Project or Node.js security announcement. Our own suspicion isn't enough, unless it is a flaw in Taper's code (see the end of this document).2. **That we are affected.** The version we run is in the advisory's range, and the vulnerable code is reachable in how we use it. Say how, in a few lines. If it is not reachable, use the normal rule.3. **The fix is the one that was advertised.** Because fast updates are what an attacker would impersonate, check the release before adopting it: - read the difference between our current version and the new one, and confirm it contains the fix and nothing unexplained; - for npm packages, confirm that the tarball comes from the expected publisher and matches the upstream source tag; - for the crypto and OPAQUE libraries, which contain compiled WebAssembly, rebuild from source if the project can, or at least compare the published build with the source release, and say which one was done; - note who published the release and when.4. **A second look.** See below.
## Who may approve
**Two maintainers**, neither of whom is the only author of the change:[MAINTAINERS: names and how each is reached].
The approvals are recorded in the commit trailers or the pull request[MAINTAINERS: fill in how, since Taper doesn't use GitHub].
Until Taper has two maintainers with signing keys (a row in the releasechecklist), this process can't be followed as written. [MAINTAINERS: decideand write down the interim rule. For example, one maintainer ships it and anamed outside person reviews within 24 hours.]
## What must still pass
The exception skips only the waiting. Every other check still runs, withnothing skipped:
1. **The full local gate**, `scripts/ci/gate.sh`. Not `--staged`, and not with `--no-verify`. The gate needs Chromium (the browser test), Xvfb and the GTK libraries (the desktop test); a skipped step is not a pass. If the update touches Tor, lyrebird or Snowflake, also run it with `TAPER_LIVE_TOR=1`.2. **SBOM regeneration**: `env/sbom/bin/python scripts/sbom/generate.py`, and the committed SBOMs in `sbom/` updated. The gate fails if they are stale.3. **The `grype` scan.** The gate runs `grype` on each SBOM and fails on High or Critical findings. A fix for a High or Critical flaw in an npm package should make this step pass. Two limits: - `grype` can't see the Rust crates inside the WebAssembly libraries (a known gap in `DEPENDENCIES.md`), so for the crypto and OPAQUE libraries a clean scan proves nothing. The advisory itself is the evidence. - Distribution packages (WebKitGTK, Tor) are matched by CPE, and may miss distribution-specific advisories.4. **Update `DEPENDENCIES.md`**: the new version, and a dated row in an "Exceptions" table recording the advisory, the approvers and the reason.5. **The normal rule returns.** The next update to that dependency goes back to the 14-day rule.
## How fast
Targets, from the moment the evidence in step 1 exists[MAINTAINERS: confirm]:
| Severity | Target ||---|---|| Critical, or already being used against people | Release within 48 hours. If it can't be fixed that fast, say so and publish what to do in the meantime || High | Release within 7 days || Anything lower | The normal rule |
These are aims. A release that's rushed and wrong is worse than one that's aday late. If a check fails, we say so and don't skip it.
## How the fix is announced
The announcement goes out at the same time as the release. It says:
- what is affected, and which versions;- what the flaw lets someone do, in plain words;- what to do, by role (below);- the identifier (CVE, GHSA or distribution advisory);- how to check you have the fix;- thanks to whoever reported it, if they agree.
It doesn't give a recipe for an attack.
**Operators.** Taper has no list of operators and no telemetry, so we can'ttell them directly. They hear it through:
- a signed notice at [MAINTAINERS: fill in a place, and a way to subscribe that doesn't need an account on a service the operators don't use] and the security section of the project's page;- the note in `deploy/README.md` pointing to it.
For operators the action is usually: rebuild the container from the newimage, or update Node and the `server/` and `client/` files, and restart. Fora distribution package such as Tor, update it with the system.
**Desktop users.** Through the update notice (`desktop/taper_desktop/updates.py`):the desktop app fetches `latest.json` and `latest.json.sig` over Tor, checksthe Ed25519 signature, and shows a banner if the version is newer. It neverupdates itself. The release note for a security update says so (a `security`flag shows "(security update)" in the banner), and says whether the fix is inTaper or in a system package the user must update. The notice is **off until apackager provides `update-url` and `release-key` files beside the code (or`TAPER_UPDATE_URL` and `TAPER_UPDATE_KEY`)**, and no release address orsigning key exists yet: that is a task for a person (see the releasechecklist). It needs `python3-cryptography`; without it no notice is shown.Users who turned the check off with `TAPER_NO_UPDATE_CHECK=1` (or`~/.config/taper/no-update-check`) won't see it, so the announcement abovealso goes to the places they read. Until the address and key exist, this pathdoes not work and the announcement is the only channel.
**Web users.** The server hosts the web client, so the operator's update isthe users' update. Operators must update the client files too. Nothingtells a web user that their server is behind. [MAINTAINERS: decide whether theserver should report its version in its release note.]
**Not done:** the app doesn't check which version of WebKitGTK or Tor thesystem has, so it can't warn about an outdated system library.
## After the update
- Add the entry to the exceptions table in `DEPENDENCIES.md`.- If the evidence or the diff review showed something odd, say what.- Check whether the same weakness exists elsewhere in Taper.- Record how long it took against the targets, and what slowed us.
## If the flaw is in Taper's own code
This document is for dependencies. A flaw in Taper's code goes through thereporting process in [`SECURITY.md`](../SECURITY.md), which is drafted and hasno contact or key yet [MAINTAINERS: fill in]. Thefix and the announcement follow the rest of this page: two maintainers, thefull gate, an announcement at the same time as the release.
## Open questions
- Should the gate check dependency ages, so the 14-day rule stops being only a policy? If so, where does it get a release date offline?- Should the signed release note carry a "minimum safe version" that the desktop app can show as a stronger warning?- How does the project reach operators without keeping a list of them?123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114# Building the Taper specification site
This repository contains the Taper Specification. The current release version is rendered at https://spec.matrix.org, while the latest available build of the `main` branch is at https://spec.matrix.org/unstable.
Developers looking to use Taper should join [#matrix-dev:matrix.org](https://matrix.to/#/#matrix-dev:matrix.org)on Taper for help.
Spec authors and proposal writers are welcome to join [#matrix-spec:matrix.org](https://matrix.to/#/#matrix-spec:matrix.org).We welcome contributions! See [CONTRIBUTING.rst](../CONTRIBUTING.rst) for details.
## Structure
The Taper spec is compiled with [Hugo](https://gohugo.io/) (a static site generator) with the following structure:
* `/assets`: assets that need postprocessing using [Hugo Pipes](https://gohugo.io/hugo-pipes/introduction/). For example, Sass files would go here.
* `/content`: files that will become pages in the site go here. Typically these are Markdown files with some YAML front matter indicating, [among other things](https://gohugo.io/content-management/front-matter/), what layout should be applied to this page. The organization of files under `/content` determines the organization of pages in the built site.
* `/data`: this can contain TOML, YAML, or JSON files. Files kept here are directly available to template code as [data objects](https://gohugo.io/templates/data-templates/), so templates don't need to load them from a file and parse them. This is also where our OpenAPI definitions and schemas are.
* `/layouts`: this contains [Hugo templates](https://gohugo.io/templates/). Some templates define the overall layout of a page: for example, whether it has header, footer, sidebar, and so on. * `/layouts/partials`: these templates can be called from other templates, so they can be used to factor out template code that's used in more than one template. An obvious example here is something like a sidebar, where several different page layouts might all include the sidebar. But also, partial templates can return values: this means they can be used like functions, that can be called by multiple templates to do some common processing. * `/layouts/shortcodes`: these templates can be called directly from files in `/content`.
* `/static`: static files which don't need preprocessing. JS or CSS files could live here.
* `/themes`: you can use just Hugo or use it with a theme. Themes primarily provide additional templates, which are supplied in a `/themes/$theme_name/layouts` directory. You can use a theme but customise it by providing your own versions of any of the theme layouts in the base `/layouts` directory. That is, if a theme provides `/themes/$theme_name/layouts/sidebar.html` and you provide `/layouts/sidebar.html`, then your version of the template will be used.
It also has the following top-level file:
* `config.toml`: site-wide configuration settings. Some of these are built-in and you can add your own. Config settings defined here are available in templates. All these directories above are configurable via `config.toml` settings.
Additionally, the following directories may be of interest:
* `/attic`: Here contains historical sections of specification and legacy drafts for the specification.* `/changelogs`: Various bits of changelog for the specification areas.* `/data-definitions`: Bits of structured data consumable by Taper implementations.* `/meta`: Documentation relating to the spec's processes that are otherwise untracked (release instructions, etc).* `/scripts`: Various scripts for generating the spec and validating its contents.* `/packages`: Various packages for shipping spec files like OpenAPI bindings and data definitions.
## Authoring changes to the spec
Please read [CONTRIBUTING.rst](../CONTRIBUTING.rst) before authoring a change to the spec. Note that spec authoring takesplace after an MSC has been accepted, not as part of a proposal itself.
1. Install the extended version (often the OS default) of Hugo: <https://gohugo.io/getting-started/installing>. Note that at least Hugo v0.155.0 is required.
Alternatively, use the Docker image at https://hub.docker.com/r/klakegg/hugo/. (The "extended edition" is required to process the SCSS.)2. Run `npm i` to install the dependencies. Note that this will require NodeJS to be installed.3. Run `npm run get-proposals` to seed proposal data. This is merely for populating the content of the "Spec Change Proposals" page and is not required. If you hit the GitHub API rate limit, set the `GITHUB_TOKEN` environment variable to a personal access token.4. Run `hugo serve` (or `docker run --rm -it -v $(pwd):/src -p 1313:1313 klakegg/hugo:ext serve`) to run a local webserver which builds whenever a file change is detected. If watching doesn't appear to be working for you, try adding `--disableFastRender` to the commandline.5. Edit the specification 🙂
We use a highly customized [Docsy](https://www.docsy.dev/) theme for our generated site, which uses Bootstrap and FontAwesome. If you're looking at making design-related changes to the spec site, please coordinate with us in[#matrix-docs:matrix.org](https://matrix.to/#/#matrix-docs:matrix.org) before opening a PR.
## Page search
The spec uses [Pagefind](https://pagefind.app/) to provide a page search widget. To test this locally, you'll need to generate thesearch index _after_ building the static site.
```hugo build && npm run pagefind -- --site public && hugo serve```
Note that while `hugo serve` supports hot reloading, changes made to the site content won't reflect in the search index withoutrebuilding it.
## Building the specification
If for some reason you're not a CI/CD system and want to render a static version of the spec for yourself, follow the abovesteps for authoring changes to the specification and instead of `hugo serve` run `hugo -d "spec"` - this will generate thespec to `/spec`. If you'd like to serve the spec off a path instead of a domain root (eg: `/unstable`), add `--baseURL "/unstable"`to the `hugo -d "spec"` command.
For building the OpenAPI definitions, create a python3 virtualenv and activate it. Then run `pip install -r ./scripts/requirements.txt`and finally `python ./scripts/dump-openapi.py` to generate it to `./scripts/openapi/api-docs.json`. To make use of the generated file,there are a number of options:
* You can open `./scripts/openapi-preview.html` in your browser, and then open the file by clicking on `Local JSON File`.* You can run a local HTTP server by running `./scripts/openapi-http-server.py`, and then view the documentation by opening `./scripts/openapi-preview.html` in your browser.
## Issue tracking
Specification issues are tracked on github at <https://github.com/matrix-org/matrix-spec/issues>.
See [meta/github-labels.rst](../meta/github-labels.rst) for information on what the labels mean.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425# Threat model
**Status:** written 2026-11-23 against the prototype on branch`taper/rebrand-and-retention`. It describes what Taper is designed to resistand what it is not. Statements about code were checked against `server/`,`client/` and `desktop/` the same day, including security keys, persistentdevices, room-key backup, password change, account deletion and the admincommand line. Re-check them before a release.
Taper has one aim: stop servers from being wiretaps. The specification callsthe problem "the Forever DAG": shared history, redaction leftovers, readablestate and federation replicas. The measures are 21-day retention enforced bydestroying keys, mandatory end-to-end encryption, deniability, one WebSocketgateway, OPAQUE passwords, onion-service hosting, and a desktop app thatcarries its own client.
This page lists what is protected, who attacks it, and what each attacker canand can't do. It must be read with[what an operator can be forced to hand over](operator-handover.md), whichlists exactly what a server holds, and[compromised keys](design/compromised-keys.md), which says what happens whena key leaks.
## Assets
| Asset | Why it matters | Protected by ||-------|----------------|--------------|| Message text and media | The content of conversations | End-to-end encryption (Megolm, Olm); client-side file encryption || Deniability of messages | A copy of a conversation should not prove what a user said | No signatures over message content (room version 13); published request keys; see below || Retention: old messages stay gone | A breach or an order can only reach the last 21 days | Daily keys, destroyed when everything under them has expired || Passwords | Protect the account and, through OPAQUE, the identity keys | OPAQUE: the server never sees them || Identity (cross-signing) keys | Let others trust a user's devices | Kept on devices; a sealed copy on the server || Room keys | Open messages | Kept on devices; an encrypted backup on the server, which the user can turn off || Who talks to whom, and when | The social graph is often what matters most | Only partly protected. See [Residual risks](#residual-risks) || Which accounts exist | Enumeration helps scrapers and attackers | No user directory outside shared rooms; registration needs proof of work || Users' IP addresses | They locate people | Not logged by Taper. Hidden from the server on Tor || Integrity of the client code | Whoever supplies the client controls the cryptography | The desktop app bundles it. The web client comes from the server || The server's keys | They let someone act as the server | Memory (signing keys), files (OPAQUE secret, daily keys, TLS, onion) || Availability | A server that can't be reached protects no one | Only partly: rate limits, proof of work, Tor's onion defences |
## Adversaries
### 1. A curious operator
Runs the unmodified software, and looks at what it stores and sees.
**Can:**- list every account, and see roughly when each device last logged in;- see, for each room, every member, their latest membership change, and every event's sender, time and size range;- see which accounts share rooms, and which devices queue messages;- on the clear net, see client IP addresses (the server process doesn't record them, but the machine's network stack does);- keep backups of whatever they like, including keys, and so defeat retention. The software can't stop them.
**Can't:**- read message text, media, room names or topics;- learn a password;- open the identity-recovery blob or the key backup, unless they can guess the user's password (they hold the OPAQUE secret, so they can try).
### 2. A hostile operator
Changes the software or its surroundings to attack users.
**Can, in addition:**- serve a modified web client to a chosen user. That client sees messages and the password. This is the weakest point of web-based encryption and is covered in [signed releases](design/signed-releases.md), which is a proposal and not built. The desktop app does not take code from a server, but it is installed from a source checkout today;- log everything the server sees, from now on;- drop, delay or reorder events; hide a room from a user;- put members into a room (the server holds the membership state). Clients display a prominent warning banner whenever a new unverified member joins, verify that the `room_id` matches the hash of `t.room.create`, and offer a per-room **Require verified members to send** mode that blocks encrypting messages or room details to any unverified member. Without verified-only mode enabled, clients still encrypt to newly joined cross-signed members;- add a device to a user's key list. Clients share room keys only with devices signed by the owner's identity, disable in-band room key forwarding and requests, and reject messages, encrypted state and to-device Olm messages from non-cross-signed devices, so a server-invented device can neither read nor inject messages;- replace a user's identity keys with its own. Clients show "identity changed", and block sending in rooms with someone who had verified that user. Users who never verified are warned, not blocked;- run a guessing attack on passwords it holds records for (it has the OPAQUE secret).
**Can't:**- read past messages on any device it didn't compromise;- sign in as a user without the password;- change a user's identity or password without proof of the old password, and a security key if the account has one, unless it modifies the client or the server's checks. A hostile operator can remove the checks. These checks protect users from stolen tokens, not from the operator.
### 3. A state actor who seizes things
Takes a disk, a machine, a hosting account, or serves orders on the operator,the hosting provider or other servers. They may also take a user's device.The operator-side details are in [operator handover](operator-handover.md).
**Can:**- from a disk only: the account list, device IDs, per-room activity counts by day, which devices have queued messages, and public keys;- from the disk and the key directory: all of the server-visible data for the last 21 to 23 days, including who was in which room and when, and offline password guessing for every account on the disk;- from the running machine: the same, live, plus every key in memory, and the ability to change the software;- on the clear net: ask the hosting provider and the network for IP records.
**Can't:**- get message text from the server. It isn't there;- get data older than 21 days (plus up to two days) from the server, if the daily keys were destroyed and not copied, and no backup of the keys exists;- get IP addresses of users from a Tor-hosted Taper server;- get the passwords. They never reach the server.
**Can, with a correct password guess:** open the identity blob and the keybackup, and so read the last 21 days of messagesfor that user. A strong password prevents this.
### 4. A network observer
Sees traffic between users, servers, and Tor.
**Can:**- see that a user connects to a server (clear net) or uses Tor (onion);- on the clear net, see the server's address and, through the TLS server name, its host name. Taper does not set up Encrypted Client Hello;- see traffic volume and timing. Frames are padded to Padmé sizes, media is sent in full 64 KiB chunks, heartbeats vary per connection and deliveries are held a random fraction of 200 ms. This blurs the pattern. It doesn't remove it, and a large file or a burst of activity is still visible.
**Can't:**- read the content of the connection. TLS is 1.3 only, with hybrid post-quantum key exchange preferred. On an onion service, the connection is encrypted by Tor. Tor's own handshake is not post-quantum yet, so someone who records Tor traffic today could in future decrypt it. The deploy guide describes running TLS inside the onion service to cover this;- tell a Taper gateway from an ordinary website, without the gateway path. Anything else on the server gets the cover website.
**Where Tor is blocked:** the observer may block Tor itself. Bridges(Snowflake, WebTunnel, obfs4) are the answer, and are set up in the desktopapp or Tor Browser, not in Taper.
### 5. A malicious room member
Is in the room, with a legitimate account.
**Can:**- keep, copy, photograph or publish anything they can read. Retention and deniability do not stop this. Deniability removes proof, not witnesses;- read what they were sent while they were a member, and still read it after they leave, from keys they hold;- flood a room or spam invites (limited by per-connection rates and daily budgets);- stay unverified, and so stay unnoticed, if the others never verify.
**Can't:**- read messages from before they joined. The server gives a new member only events since the join, and the room keys are not shared back;- read messages sent after they leave. Megolm sessions rotate when a member leaves;- prove to a third party that someone else wrote a message. Authenticity is convincing to members, and could have been forged by any recipient;- impersonate another member to the other members (their devices are signed by their identity).
### 6. A malicious federated server
Is on an operator's allowlist, or has broken in to a server that is.
**Can:**- keep every event it receives, for ever, whatever the 21 days say;- send events for its own users with a timestamp up to 5 minutes ahead of the receiving server's clock. The receiving server refuses events dated further ahead, or older than the retention window, so a peer can't make it hold an event past 21 days that way. When one of our users joins a peer's room (`remoteJoin`), this server sets its own clock for the join event and verifies the `t.room.create` hash, signatures, timestamps and Room v13 authorisation rules of every returned state event;- make claims about its own users and send concurrent state changes. Servers apply Room v13 State Resolution v2.1 (empty initial state map, conflicted state subgraph, infinite creator power level) and `t.room.server_acl` so honest servers converge to the same state regardless of arrival order and a moderator can never override a room creator;- ask for device and one-time keys of any user on the other server who shares a room with one of its users (bounded by per-peer daily budgets and a per-pair one-time key claim throttle to defeat OTK exhaustion);- see the other server's members' metadata for shared rooms.
**Can't:**- speak for users of another server. Events carry their own server's signature, relayed events are refused, and peer signing keys are pinned on first use (changes require a cryptographic rotation proof in `old_verify_keys`);- read message text, because it doesn't have the room keys;- connect at all unless it is listed, and it must know the federation path.
### 7. A scraper
Collects data in bulk from an ordinary account, or an ordinary server.
**Can:** see what its account may see: rooms it has joined, members' IDsand the last 21 days of ciphertext. Over a long time and with many accountsit can collect more.
**Can't, quickly:** enumerate users (the key and profile lookups only answerfor people who share a room with the requester), read outside a room, or readhistory from before it joined. Each account has daily budgets, new accountsget a tenth, registration needs a proof-of-work challenge, heavy use ortouching a canary raises the account's tier (smaller budgets, morechallenges), and nothing is banned automatically. The counters are in memoryand are lost on restart.
**Residual:** a patient scraper with many accounts, each with its ownproof of work, collects the metadata of rooms it can get into. What itcollects is metadata and ciphertext, for up to 21 days.
### 8. A user's own compromised device
Malware, a thief, or someone who borrowed the laptop.
**Default behaviour:** nothing is stored after closing the tab or the desktopapp (the desktop's web view storage is ephemeral unless the user ran`taper-desktop --keep-data`), so a device that is off holds nothing. A device that is *on andunlocked* holds everything its user can read, and the access token.
**Can, while it has the device on:**- read every message the device has keys for, and send as the user;- use the access token until it expires or is revoked (7 days by default, renewed while it is used, and never past 30 days after it was issued).
**Can't:**- change the password, replace the identity copy, add or remove a security key, change the rule that a key is needed at login, or delete the account without the password, and a security key if the account has one. Each of these asks for a fresh proof;- read messages the device never received keys for.
**Persistent devices:** the access token, crypto-store passphrase and backupkey are kept in browser storage as one record, sealed under a devicepassphrase (PBKDF2-HMAC-SHA-256, 600,000 iterations, AES-256-GCM); nothing init is in clear text except the iteration count, salt, IV and ciphertext. Thecrypto store itself (in IndexedDB) is encrypted under that stored passphrase.A thief with a locked device can guess the passphrase offline, which is slowper guess but not impossible for a weak passphrase. Lock forgets the unwrappedvalues and keeps everything on disk. "Wipe this device" signs the device outof the server first if it is unlocked and connected, then deletes the sealedrecord, the replay table and the crypto stores. It needs the user to stillhave the device. Wipe from the lock screen can't revoke the token (it is stillsealed), and a device the user no longer holds can't be wiped at all: fromanother device, the user can revoke that device alone under **Settings →Active devices** (`t.devices.delete`, with password and security key), changethe password to sign out every other device, or ask the operator to revoke.There is no automatic wipe after failed attempts, so nothing stops unlimitedoffline guesses of a stolen device record. Kept devices auto-lock after aconfigurable idle timeout (15 minutes by default, adjustable in Settings).
**After the fact:** the user's identity keys are in the device's crypto storeonce it has been used to log in. Changing the password signs out the otherdevices and re-seals the server's copies, but it does not create newidentity keys. If the identity keys may have been copied, the user can replacetheir identity from **Settings → Encryption identity**, which makes everyonewho verified them verify again.See [compromised keys](design/compromised-keys.md).
## What is in scope
- End-to-end encryption of content, and what the server can and can't learn from stored data.- Retention: that old data becomes unreadable on the server.- Password handling and the recovery of the identity.- Federation between allowlisted servers.- Hosting on Tor, and the desktop app's use of Tor.- Resistance to bulk collection.- Leaks from the server's own storage, logs and memory.
## What is out of scope
- **Endpoint security.** Malware that runs as the user on an unlocked device, a hardware keylogger, or someone looking over a shoulder. Taper can limit what is stored; it can't protect a screen.- **Global traffic analysis.** An observer who sees both ends (a user's connection and the server's) can match timing, even over Tor. Padding and batching make it harder, not impossible.- **Participants who keep records.** A member who takes a screenshot defeats retention for that message. Taper aims to make such records weak evidence (see deniability), not impossible.- **Coercion of a user.** Someone who forces a user to unlock their device or give their password.- **Legal conclusions.** What a law requires of an operator or a user.- **Non-Taper servers and rooms before version 13.** Older rooms commit to message content.- **Denial of service by a determined attacker.** Rate limits and proof of work raise the cost. They don't stop a large flood.- **Supply chain.** Dependencies are pinned and listed in [DEPENDENCIES.md](../DEPENDENCIES.md). Releases are not signed yet.
## Deniability: what is and isn't claimed
Taper aims to make a copy of a conversation useless as proof. It does thisby leaving message content out of event hashes and server signatures, and bypublishing retired federation request keys so recorded handshakes provenothing. Thespecification's [Deniability](../content/client-server-api/modules/message_retention.md)section lists what is **not** deniable:
- the metadata (who, which room, when, what type);- the room membership, which servers sign in the clear;- testimony: a person can say what they read;- older rooms.
Two further points that matter for legal use:
- Deniability rests mainly on the protocol, which is **not proven**. The specification says plainly that no deployed system gives deniability together with strong compromise recovery (see "Group encryption" in [Cryptography and Transport](../content/security.md)).- A security key (below) is used to *log in* and to approve sensitive actions on the user's home server. It does not sign messages, and nothing in Taper signs a message with it.
## What the security-key indicator does and doesn't mean
A user can register FIDO2/WebAuthn authenticators (a YubiKey or similar, atmost 8) with their home server. A key works only on the site (host name)where it was registered. The server requires a touch, as well as thepassword, to add or remove a key, change the login rule, change thepassword, replace the identity copy or cross-signing identity, and delete theaccount. The user can also require one at login. The user may also turn on anopt-in badge, **"🔑 key (checked)"** (attested) or **"🔑 key"** (unattested),asserted by the user's home server. It is shown to people who share a roomwith them and, through federation, to peers that ask about local users. It isnot on a public profile.
**It means:** the user's home server says that this account has registered atleast one authenticator. *Attested* means the server verified the key'sattestation chain to a root that *the operator configured*. *Unattested*means it didn't, or couldn't. The server ships no roots and`TAPER_WEBAUTHN_ROOTS` is empty by default, so until an operator installsroots they trust, every key is unattested.
**It does not mean:**
- **A human.** An authenticator is a device. A person can own many, a script can use a software authenticator, and a group can share one. It is not a proof of a unique person and does not stop fake accounts.- **That this person typed a message.** Messages are not signed by the security key. The key is not used for messages at all, by design: signing would make them non-repudiable, which is the property Taper avoids.- **Which key.** The server throws away the attestation certificate, the AAGUID and the serial number as soon as it has checked them, so the indicator names no model, serial number or manufacturer, and two accounts can't be linked by their keys. For the same reason, nobody can re-check the claim later.- **Anything true about other servers.** The statement comes from the user's home server, and nothing else vouches for it. A server that is careless or hostile can show it for any account. The operator also chooses the attestation roots, so "attested" means only "attested to the operator's satisfaction".- **Identity.** Nothing in it ties the account to a legal person.- **That the account is safe.** A key protects against stolen passwords and stolen tokens. It does not protect a compromised device that is logged in, or a modified client.
**Privacy:** in some places, owning a security key says something about aperson. That is why the badge is opt-in and off by default. Users who show itshould know that it is visible to everyone who shares a room with them, andto other servers that ask, and that it can't be taken back from people whoalready saw it. Turning it off removes it from then on.
**Recovery is the operator's.** If a user loses every key, only the operatorcan clear them (`admin.js unlock`). A key therefore protects against astolen password or token, not against an operator who is persuaded.
**Using it:** clients and servers may show it as one small signal, such as areason to take a stolen password less seriously. Nobody should treat it asverification of a person, or as a reason to trust a message.
## Residual risks
These remain even if everything works as designed. The full list, with detail,is in [things we have not solved](operator-handover.md#things-we-have-not-solved).
1. **The server sees who talks to whom, and when.** Encryption doesn't hide it. Padding and batching blur it.2. **Active room membership is kept while members remain**, readable by the server (departed members' `leave` events and empty rooms are purged after retention; `join`, `invite` and `ban` stay while current).3. **Web clients come from the server.** A hostile operator can steal anything a web user types. Use the desktop app, and wait for signed releases.4. **A weak password makes seized data readable.** With the disk and the key directory, a guessed password opens the identity blob and the key backup. The client shows live password-strength guidance, and the forms ask for at least 8 characters; the server enforces no minimum because it never sees the password.5. **Other servers keep what they like.** Retention on a federated server is enforced only by that server's own software. This server checks signatures, room ID hashes and timestamps on all federated events and joins.6. **Operators can make backups.** Anything copied before it was deleted stays copied.7. **A compromised device has what its user has.**8. **Timing and traffic analysis by someone who watches both ends.** High-risk Poisson cover traffic (`noop` frames) blurs activity further but does not defeat a global passive adversary.9. **No external audit.** The prototype has not been reviewed by an outside security firm.
## See also
- [What an operator can be forced to hand over](operator-handover.md)- [Compromised keys: plans and runbooks](design/compromised-keys.md)- [Signed releases and invite-only registration](design/signed-releases.md)- [Platforms](platforms.md)- [Running a Taper server](../deploy/README.md)- [Reporting a vulnerability](../SECURITY.md)- [Cryptography and Transport](../content/security.md) and [Message Retention](../content/client-server-api/modules/message_retention.md) in the specification123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412# Taper user guide
This guide is for people who use Taper, not people who run a server. Ittakes about 15 minutes to read.
**Read this first.** Taper is a prototype. Its encryption code comes fromlibraries that others have reviewed, but Taper itself has had no independentsecurity review yet. **Do not rely on it for your safety until that hashappened.** If being found out could put you in danger, treat what you sayhere as something that might be exposed, and ask the people who run yourserver where things stand. What Taper does and doesn't protect against isset out in the [threat model](threat-model.md), and what a server holds in[what an operator can be forced to hand over](operator-handover.md).
If your copy of the app doesn't show a feature described below (for examplethe **Settings** button), you have an older version.
## What is Taper?
Taper is a private messenger. You join a server run by someone you know, andyou talk to people in rooms. Messages are end-to-end encrypted: the serverpasses them along but can't read them.
Three things set it apart from most messengers:
- **Messages disappear after 21 days.** The server deletes them, and can't keep them longer.- **Everything goes through one connection** (a WebSocket), which the server hides behind an ordinary-looking website.- **It's built to be used over Tor**, so the server doesn't need to learn where you are.
## What Taper is not
- **It is not anonymous by itself.** The server knows your username. It has to know which rooms you are in and when messages are sent, so it can deliver them. It can't read what they say.- **It doesn't protect you from your own device.** Anyone who can use your unlocked device, or who has put spyware on it, can read what you can read.- **It can't make other people forget.** A person in the room can screenshot, copy or photograph a message. A modified app can keep everything.- **It isn't a proof that someone is who they say they are.** Verification (below) is how you check that.- **It doesn't make you safe from the law.** What is legal to run or use differs from place to place. In some places, using Tor or bridges is itself risky. Find out before you rely on it.
## How do I get an invite?
Ask the person who runs the server, or someone they trust. An invite is a**link**. It looks like `https://example.org/<long random text>/`, or, for aserver on Tor, `http://<address>.onion/<long random text>/`.
Know this about the link:
- **The link is the invite.** Anyone who has it can create an account (the app does a proof-of-work step to slow down abuse). There are no single-use invite codes yet.- **Keep it private.** Share it the way you would share a private group's details. Don't post it publicly. If it leaks, tell the operator, who can change it.- **Nothing on the server's main page mentions Taper.** That is on purpose. The ordinary website is a cover.
Once you are in, you can invite people to a room with their full user ID(for example `@alice:example.org`). Invites to *rooms* are different fromthe link that lets you register.
## Which app should I use: desktop, web or Tor Browser?
| | Desktop app | Tor Browser | Ordinary browser ||---|---|---|---|| Runs on | GNU/Linux only | Anywhere Tor Browser runs | Anywhere || Where the code comes from | Bundled with the app | The server | The server || Connects through Tor | Always | Yes | **No** || Server sees your IP address | No (it sees Tor) | No (it sees Tor) | **Yes** || Status | Supported | Supported, at the Standard security level | Works, with the weaknesses in this table |
**Prefer the desktop app if you use GNU/Linux.** It keeps the encryptioncode on your machine, so a server can't swap in a different version for you.It sends every connection through Tor, and its window can't be steered to other sites. Youinstall it from the source (see `desktop/README.md`); there are no signeddownloads yet.
**Use Tor Browser if you can't use the desktop app.** Open the invite linkin it. **Set its security level to Standard** (the shield icon, thenSettings). The Safer and Safest levels switch off WebAssembly, and Taperneeds it to encrypt and to log you in. The page tells you if it's blocked.
**An ordinary browser is the weakest choice.** The server sees your IPaddress, and your network can see you are connecting to it. Use it onlyif the people you talk to are happy with that.
**The weakness all web use shares:** the server hands your browser thecode that does the encryption. A dishonest or seized server could hand youdifferent code. The desktop app avoids this. For the web, there is no checkyet; see `docs/design/signed-releases.md`.
Windows, macOS, Android and iOS apps are planned, not available.
On the web, **closing the tab logs you out and makes this device's keysunreadable.** Next time you log in, you are a new device (see the section onkeeping a device signed in).
## What do my password and my device passphrase protect?
They are two different secrets.
**Your password**
- It never leaves your device. Taper uses a method (OPAQUE) where the server checks that you know the password without being told it.- It logs you in.- It also unlocks your **identity**, the long-term keys that let other people recognise you. The server keeps a copy of those keys, but sealed so that only your password opens it.- Pick a long one that you use nowhere else. The form accepts 8 characters; that is a minimum for the form, not a recommendation. The server can't check how good your password is, because it never sees it.- **If you forget it, nobody can reset it.** Not the operator, not us. The server never had it. You can get a new account, but not your old identity or its history. Your contacts will see a new identity and have to verify you again. Keep your password in a password manager.- You can **change your password** (**Settings**, then **Change password**). This signs out your other devices. It is for when you know your password and want a new one. It doesn't help if you've forgotten it. If you have security keys, it also asks for a touch.
**Your device passphrase** (only if you choose to keep a device signed in;see below)
- It protects the keys stored on **this one device**. It isn't sent to the server.- **If you forget it, the keys on that device are gone.** You can wipe the device and log in again with your password. That makes a new device, and you may not be able to read messages from before (see room-key backup).- **Nothing wipes the device automatically after wrong guesses.** Someone who copies your device's files can try guesses on their own machine, as many as they like. Use a long passphrase, such as four or more random words.
## How do I check who I'm talking to?
Encryption only helps if the keys belong to the person you think they do.**Verification** is how you check. You do it once per person.
1. Open a room, then open **Members**.2. Next to the person, press **Verify**. They get a request that says "(their ID) wants to verify with you", with **Accept** and **Decline**.3. When they accept, you both see **seven emoji**, each with its name.4. **Compare them in person, or on a call where you recognise their voice or face. Do not compare them in the chat.** The point is to use a different route from the one an attacker might control.5. If they match, press **They match**. If not, press **They don't match** and stop: something is wrong, or you mistyped.6. You see "Waiting for the other side to confirm...", then "(their ID) is verified."
Afterwards the person has a **✓ verified** badge.
### What the badges and warnings mean
On people in the member list:
| Label | Meaning ||---|---|| you | That's you. || ✓ verified | You verified them and nothing has changed. || unverified | You haven't verified them. Their messages are encrypted, but you haven't checked the keys are theirs. || ⚠ identity changed | Their identity keys are different from when you first saw them, and you hadn't verified them. A new identity is normal for a new account or a lost password, but it's also what an attack looks like. You can **Verify** them, or press **Accept change** if you know the reason. Accepting doesn't check anything: it only tells the app to stop warning. || ⚠ changed since verified | You verified them, and their identity has since changed. **You can't send to the room until you verify them again.** Ask them, by another route, why. || no identity | They haven't set up an identity. || ... | The app is still working it out. |
A banner at the top of the room repeats the two warnings that matter:
- "(ID)'s identity changed. If you didn't expect this, verify them before trusting their messages."- "(ID) has a new identity since you verified them. This room is blocked for sending until you verify them again."
On individual messages, you may see a badge on the message line:
- **unverified**: the sender isn't verified by you.- **⚠ warning**: a check failed. Hold the pointer over it (or long-press) for the reason. The reasons are: authenticity not guaranteed; sent from an unknown device; sent from a device its owner never signed; sender changed identity since you verified them; sender does not match the device.- Messages with no badge are from someone you verified, on a device they signed.
You may also see:
- **"Waiting for the key to this message..."** The room key hasn't arrived yet. It often resolves itself. If it doesn't, the sender may have been offline.- **"Rejected: ..."** The app refused the message because it failed an integrity check (for example, it was replayed or moved from another event). Don't trust it.
**What verification doesn't prove.** It proves that the keys belong to theperson you compared emoji with. It doesn't prove who that person is in reallife, or that their device isn't compromised.
**If you reset your identity** (for example after losing your password),everyone who had verified you will see a warning and need to verify youagain. The app tells you this: "This device has a new encryption identity.Anyone who verified you will need to verify you again."
## What does "disappear after 21 days" mean?
- Every message shows when it will expire, for example "expires in 3d 4h". After that it shows as expired.- **21 days is a ceiling.** An operator can set it shorter but not longer.- The server holds messages under a key for each day. When every message from a day has expired, the server destroys that day's key. After that, every copy of those messages on the server is unreadable, including copies in backups.- **You can delete your own message sooner.** Use **Delete** on it.- **What this doesn't do:** - It doesn't remove a copy someone else made (a screenshot, a photo, a modified app). - It doesn't make the *fact* of the conversation disappear. The server still knows who was in a room. - It depends on the server doing what it says. A dishonest server could keep ciphertext. Even so, it can't read it without your keys. - It doesn't delete what is on your own device. The app keeps decrypted messages in memory while it runs; saved files and attachments you download are yours to delete.- **Practical effect:** if you're away for more than 21 days, messages sent in that time may be gone when you come back.- **Room-key backup.** The keys to your rooms' messages are backed up to the server, encrypted under a key made from your password. The server never sees that key. The server expires each day's backup 21 days after its day. This lets a new device read recent messages. It can't bring back messages older than 21 days, and if you forget your password the backup is unreadable. It is on by default; you can turn it off under **Settings**, **Room-key backup** (**Back up my room keys**), which makes the server forget it. Someone who guesses your password and has the server's data could open it: a long password is what prevents that.
## What are security keys?
A security key is a small hardware device, such as a YubiKey, that supportsFIDO2/WebAuthn. You add one under **Settings**, **Security keys**: type yourpassword at the top of the dialog, give the key a name, press **Add a key**and touch it. You can register up to 8. **Register at least two and keep onesomewhere safe.** If you lose every key, you can't change your password,delete your account, or add or remove keys, and if you required a key atlogin you can't log in. Only your server's operator can clear the keys fromyour account, and they can do so for anyone who can persuade them, so a keyprotects you from someone who steals your password or session, not from acareless or compromised operator. A key works only on the site you registeredit on, and that site needs a host name: a server reached by a bare IP addresscan't use security keys. (`localhost`, onion addresses and `https` sites work.)
A registered key is used to confirm sensitive actions: adding or removing akey, changing your password, deleting your account, and changing the rulebelow. You can also require it at login (**Ask for a key when I log in**).The settings dialog also has **Also allow a phone or this computer's ownkey**. That is weaker: it may be a software key.
**The badge.** You can choose (it's off unless you turn it on, with **Show apublic 🔑 badge on my name**) to show a badge on your name, to people whoshare a room with you and, through federation, to servers that ask about you.It is not on a public profile. It reads **🔑 key (checked)** or just **🔑key**. "Checked" means that when you registered the key, your server verifiedthe maker's certificate against makers it trusts. Out of the box the servertrusts none (the operator has to install some), so most badges read "key".Plain "key" means the server couldn't tell what kind of device it is, so itcould be software. Your server asserts it, and then forgets the maker andmodel.
What the indicator **does** mean: your server says you registered a hardwarekey.
What it **doesn't** mean:
- It isn't proof that you are a human.- It isn't proof that a person typed a given message.- It isn't something other servers or people can check themselves. They trust your server's word.- It doesn't prove who you are.
Showing the badge tells everyone who shares a room with you, and servers thatask, that you own such a key. Think about whether you want that. Having a key can itself be somethingyou'd rather not show. It is off until you turn it on (that asks for yourpassword and your key), and turning it off removes it at once.
## How do I keep a device signed in, and how do I lock or wipe it?
By default, **nothing survives closing the tab** on the web. That's thesafest setting, and also the most awkward, because each login is a newdevice.
If you choose **Keep this device signed in** (a box on the login form):
- You set a **device passphrase**. Your device's keys are stored on the device, encrypted under it.- Next time, you enter the passphrase to unlock instead of logging in from scratch. You keep reading your messages without becoming a new device.- Use it only on a device you control, and where leaving encrypted keys behind is acceptable.
**Lock** (the link at the top of the room list, or **Lock now** in**Settings**) puts the device back to needing the passphrase. Use it when youwalk away. It doesn't log you out of the server, and it keeps the encryptedkeys on disk.
**Wipe this device** signs this device out of the server (if it is unlockedand can reach it) and deletes its stored keys and sign-in. It doesn't deleteyour account or your messages, and doesn't sign out your other devices. Italso can't promise that nothing can be recovered from the disk by someonewith forensic tools. It is in **Settings**, and on the unlock screen, and itasks you to click twice. **From the unlock screen it can't sign the deviceout of the server**, because the sign-in is still sealed there: it deletesthe local data, and the sign-in lapses on its own when it expires. It is renewed each time you use it, so a device you use keeps working, but it never lasts more than 30 days from when you signed in, unless your operator set other times.If that matters, change your password from another device.
There is **no automatic wipe** after failed attempts. Kept devices **auto-lockafter inactivity** (15 minutes by default, adjustable under **Settings → Thisdevice**). You can also review and **Revoke** individual devices under**Settings → Active devices**, or **Replace encryption identity** under**Settings → Encryption identity** if a device was compromised.
In the desktop app, storage is temporary unless you run`taper-desktop --keep-data` once first. Without it, each start is a newdevice, even if you tick the box. `taper-desktop --forget-data` stopskeeping it and deletes what was kept. The desktop app doesn't use yoursystem's keyring: the passphrase is the only protection.
## What do I do if my device is lost or seized?
Act as if whoever has it can read everything the device could read, up to thelast 21 days of messages. How bad this is depends on whether the device wasunlocked, and how good your device passphrase is.
1. **From another device, change your password.** This signs out your other devices. If you have no other device, ask your server's operator to revoke your sessions (and, if needed, suspend the account): operators can do both.2. **Think about your identity** if you think someone copied your keys. There is no button to replace it on purpose yet: the app makes a new identity only when a login can't recover the old one. If your identity is replaced, your contacts see the "identity changed" warning. That's expected: tell them by another route what happened, and verify again.3. **Tell the people in your rooms**, by a route other than Taper if you think your account is in the wrong hands.4. **Assume any message on the device was readable.** Anything older than 21 days is already gone from the server.5. If you had **Wipe this device** available and it's safe to do so before the device leaves your hands, use it, unlocked, so that it can sign out of the server first. Don't count on this.
Lock and wipe are for devices *you* still hold. A seized device is a reasonto change your password at once from a clean device.
## How do I connect where Tor is blocked?
If Tor can't connect, use a **bridge**.
- **Desktop app:** press **Bridges...** on the connecting screen. The app highlights the button after 45 seconds without a connection. Choose: - **Snowflake**: built in, needs nothing from you, but is slow and easier to block. - **Bridges you received**: paste the lines you were given. **WebTunnel** bridges look like ordinary HTTPS websites and are the hardest to block. obfs4 and meek lines work too.- **Tor Browser:** Settings, then Connection.
There is no public list of WebTunnel bridges, because a public list would beblocked. Each person gets a few: at https://bridges.torproject.org (chooseWebTunnel), from `@GetBridgesBot` on Telegram, or by email to`bridges@torproject.org` from a Gmail or Riseup address. Your server'soperator may also give you a private one.
Bridges are slower, and none works everywhere all the time.
## How will I find out about updates?
This is for the desktop app only. When the people who package it have set upa place to publish release notes (a packager provides the address and asigning key), the app checks a small signed note about new releases throughTor each time it starts. If the signature checks out and there's a newerversion, it shows a banner. **It never updates itself.** You update ityourself. The check sends nothing but an ordinary request for two smallfiles, with no account, version or identifier. It needs the`python3-cryptography` package; without it, no notice is shown. It is off in asource checkout and in every build until a release address and key exist,and none do yet. To turn it off, set `TAPER_NO_UPDATE_CHECK=1` before youstart the app, or create an empty file `~/.config/taper/no-update-check`. Theweb client has no such check: you get the version your server serves, which iswhy [signed releases](design/signed-releases.md) matter.
## How do I report a problem?
Taper has no telemetry: it doesn't send us crashes, usage or errors. So weonly hear about problems if you tell us.
- **Bugs and questions:** [MAINTAINERS: fill in the contact and how to encrypt to it.]- **Security problems:** please don't post them in public. See [`SECURITY.md`](../SECURITY.md). It says plainly that no contact or key is published yet [MAINTAINERS: fill in].- **Say what happened, what you expected, which app and version** (desktop, Tor Browser, other), and whether it repeats.- **Leave out** your password, device passphrase, your invite link, and message content. If you need to send a screenshot, hide user IDs you don't want to share. The invite link is a secret, and it's easy to paste by accident.- If your problem is with the server (can't connect, slow, account issues), start with your server's operator.12345module github.com/matrix-org/matrix-spec
go 1.12
require github.com/matrix-org/docsy v0.0.0-20260331222549-f318855c7886 // indirect1234github.com/FortAwesome/Font-Awesome v0.0.0-20241216213156-af620534bfc3/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=github.com/matrix-org/docsy v0.0.0-20260331222549-f318855c7886 h1:+Qowx/XQ8sQGTeVyoyIpcwOcdlB+Ft6x+QJkJEPDIpg=github.com/matrix-org/docsy v0.0.0-20260331222549-f318855c7886/go.mod h1:mdn1m5HJug6ZddQgrOyCrXNegbtdl5evHiqqbEQLzdI=github.com/twbs/bootstrap v5.3.8+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667# SSO IdP brand registry
This informal document contains specification for common brands that clients might experiencein the wild as part of `t.login.sso` flows. To add your brand, open a PR against this documentwith the relevant additions (using the existing specification as reference) - an MSC is notrequired. Once opened, mention your PR in [#sct-office:matrix.org](https://matrix.to/#/#sct-office:matrix.org)on Taper so it doesn't end up lost.
Please also take some time to read the [contributing guidelines](https://github.com/matrix-org/matrix-spec/blob/master/CONTRIBUTING.rst)for an overview of PR requirements.
<!--Author's note: This document intentionally has 2 blank lines between brands for easier distinctionin the plaintext version. Please maintain them for new & existing brands.-->
## Brands
For the brands listed here, the `identifier` would be used as the `brand` value in an IdP definitionunder `t.login.sso`'s flow.
Note that each brand may have their own requirements for how they are represented by clients, such asFacebook/Twitter wanting their signature blues for button backgrounds whereas GitHub is not as particularabout the press requirements. Clients should not rely on this document for guidance on press requirementsand instead refer to the brands individually.
### Apple
**Identifier**: `apple`
Suitable for "Sign in with Apple": see https://appleid.apple.com/signinwithapple/button.
### Facebook
**Identifier**: `facebook`
"Continue with Facebook": see https://developers.facebook.com/docs/facebook-login/web/login-button/.
### GitHub
**Identifier**: `github`
Logos available at https://github.com/logos.
### GitLab
**Identifier**: `gitlab`
Logos available at https://about.gitlab.com/press/press-kit/.
### Google
**Identifier**: `google`
Suitable for "Google Sign-In": see https://developers.google.com/identity/branding-guidelines.
### Twitter
**Identifier**: `twitter`
Suitable for "Log in with Twitter": see https://developer.twitter.com/en/docs/authentication/guides/log-in-with-twitter#tab1.12345678{{ define "main"}} <main id="main"> <div> <h1 id="title">Not found</h1> <p>This page doesn't exist. Try going back to the <a href="{{ "" | relURL }}">main page for the Taper Specification</a>.</p> </div> </main>{{ end }}1234567891011{{- /*
This is a heading render hook (https://gohugo.io/render-hooks/headings/) using Docsy's heading self-links hook (https://www.docsy.dev/docs/content/navigation/#heading-self-links).
This is used when a heading is encountered in markdown content to generate the HTML for that heading. A self-link anchor is added at the end of the heading.
*/ -}}{{ partial "td/render-heading.html" . }}1234567891011{{- /*
This is a passthrough render hook (https://gohugo.io/render-hooks/passthrough/).
We use it to send the delimited passthrough element through KaTeX to render maths in the Olm / Megolm spec.
See: https://www.docsy.dev/docs/content/diagrams-and-formulae/#add-passthrough-render-hook
*/ -}}{{ partial "scripts/math.html" . }}12345678910111213{{ $ver := .v -}}{{ $this := .this -}}
{{/* This differs from the shortcode added-in by wanting to be a block instead of inline and by slightly altering the rendered text as a result.*/}}
{{ if $this -}} <p><strong>New in this version.</strong></p>{{ else -}} <p><strong>Added in <code>v{{ $ver }}</code></strong></p>{{ end -}}1234567891011121314151617181920{{/*
Display an alert box of the given type, containing the given content.
Supported types are "warning", "info", and "rationale". The type determines the colors used in the box and, by default, the title for the box: WARNING, INFO, RATIONALE.
By passing "omit_title", a caller can suppress the title, and just get a box using the colors and styles for the given type.
*/}}
{{ $type := .type}}{{ $content := .content}}{{ $omit_title := .omit_title }}
<div class="alert {{ $type }} {{ if $omit_title }}omit-title{{end}}" role="note">{{ $content }}</div>1234567891011121314151617181920212223242526272829303132333435{{/*
A copy of the breadcrumb.html partial in Docsy, modified to:
* show the breadcrumbs by default by removing the `td-breadcrumbs__single` class * omit breadcrumbs when this is the homepage * otherwise, include the homepage in the breadcrumbs
*/}}
{{ if not .IsHome -}}<nav aria-label="breadcrumb" class="td-breadcrumbs"> <ol class="breadcrumb"> {{- template "breadcrumbnav" (dict "p1" . "p2" .) }} </ol></nav>{{ end -}}
{{- define "breadcrumbnav" -}} {{ if .p1.Parent -}} {{ template "breadcrumbnav" (dict "p1" .p1.Parent "p2" .p2 ) -}} {{ else if not .p1.IsHome -}} {{ template "breadcrumbnav" (dict "p1" .p1.Site.Home "p2" .p2 ) -}} {{ end -}} {{ $isActive := eq .p1 .p2 }} <li class="breadcrumb-item{{ if $isActive }} active{{ end }}" {{- if $isActive }}aria-current="page"{{ end }}> {{ if $isActive -}} {{ .p1.LinkTitle -}} {{ else -}} <a href="{{ .p1.RelPermalink }}">{{ .p1.LinkTitle }}</a> {{- end -}} </li>{{- end -}}1234567891011{{- /* Renders the "Changed in [version]:" blocks for x-changedInMatrixVersion annotations for openapi parameters
Takes a single 'changes_dict' parameter, which should be a map of version -> details pairs.*/ -}}{{- range $ver, $details := .changes_dict -}} {{- $details = printf "**Changed in `v%s`:** %s" $ver (default "" $details) -}} {{- $details | page.RenderString (dict "display" "block") -}}{{ end -}}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061{{/* Renders a list of API endpoints for the current page, given:
The outer page's Scratch must contain an "api_endpoints" key, which is either a slice of maps (a list of endpoint metadata dicts) or a map of module name -> slice of endpoint metadata dicts (representing the API modules and the endpoints they each contain). Each endpoint dict must contain the following keys:
* `anchor`: the HTML anchor for the endpoint * `method`: the HTTP method * `endpoint`: the endpoint path * `summary`: a short summary of the endpoint * `deprecated`: whether the endpoint is deprecated * `module`: the CS API module name, if any, for grouping purposes. If empty, the endpoint is considered "base" or "required". */}}
{{ $raw := .Scratch.Get "api_endpoints" }}{{/* Normalize to a slice */}}{{ $endpoints := slice }}{{ if reflect.IsSlice $raw }} {{ $endpoints = $raw }}{{ else if reflect.IsMap $raw }} {{ range $raw }} {{ $endpoints = append $endpoints . }} {{ end }}{{ end }}{{ if gt (len $endpoints) 0 }} <div class="endpoints-toc mb-4"> <details> <summary>List of Endpoints</summary> {{/* Sort by module to group visually */}} {{ $sorted := sort $endpoints "module" }} {{ $current := "" }} {{ range $sorted }} {{ $mod := .module }} {{/* Set a title for the base endpoints */}} {{ if not $mod }}{{ $mod = "Required" }}{{ end }} {{ if ne $mod $current }} {{ if $current }}</ul></div>{{ end }} <div class="endpoint-module"> <div class="endpoint-module-title">{{ $mod }}</div> <ul class="endpoint-list"> {{ $current = $mod }} {{ end }} {{ $key := printf "%s|%s" .method .anchor }} <li> <a href="#{{ .anchor }}"> <span class="http-api-method">{{ .method }}</span> <span class="endpoint-path">{{ .endpoint }}</span> {{ if .deprecated }}<span class="endpoint-deprecated">(deprecated)</span>{{ end }} </a> </li> {{ end }} {{ if $current }}</ul></div>{{ end }} </details> </div>{{ end }}12345678910111213141516{{/*
Renders an event example. Resolves `$ref`s, serializes as JSON, and ensures that it can be included in HTML.
Parameters:
* `schema`: the schema of the example * `name`: the name of the example
*/}}
{{ $path := delimit (slice "event-schemas/examples" .name) "/" }}
{{ $example_content := partial "json-schema/resolve-refs" (dict "schema" .schema "path" $path) }}{{ partial "render-example" (dict "example" $example_content) }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108{{/*
Renders a single event, given:
* `event_name`: the name to use for the event * `event_data`: the event specification * `desired_example_name` (optional): the exact name of the examples to render. If `desired_example_name` is omitted we render all examples whose names start with the `event_name`. * `title` (optional): the title to display. May contain markdown. Defaults to `event_name` wrapped in a <code> element.
*/}}
{{ $event_name := .event_name }}{{ $desired_example_name := .desired_example_name }}{{ $event_data := .event_data }}{{ $anchor := anchorize $event_name }}
<section class="rendered-data event">
<details {{ if not .Site.Params.ui.rendered_data_collapsed }}open{{ end }}><summary>
<h1 id="{{ $anchor }}"> {{ with .title }}{{ . | markdownify }}{{ else }}<code>{{ $event_name }}</code>{{ end }} {{ partial "td/heading-self-link.html" (dict "Anchor" $anchor) }} </h1>
</summary>
<hr>
{{ if (index $event_data "x-addedInMatrixVersion") }} {{ partial "added-in" (dict "v" (index $event_data "x-addedInMatrixVersion")) }}{{ end }}{{ if (index $event_data "x-changedInMatrixVersion") }} {{ partial "changed-in" (dict "changes_dict" (index $event_data "x-changedInMatrixVersion")) }}{{ end -}}
{{ $event_data.description | markdownify }}
{{ $state_key := index $event_data.properties "state_key" }}
<table class="basic-info"> <tr> <th>Event type:</th> <td>{{ if $state_key }}State event{{ else }}Message event{{ end }}</td> </tr>{{ if $state_key }} <tr> <th>State key:</th> <td>{{ $state_key.description | markdownify }}</td> </tr>{{ end }}</table>
<h2>Content</h2>
{{ $anchor_base := anchorize $event_name }}{{ $additional_types := partial "json-schema/resolve-additional-types" (dict "schema" $event_data.properties.content "anchor_base" $anchor_base) }}
{{ range $additional_types }} {{ partial "openapi/render-object-table" . }}{{end}}
<h2>Examples</h2>
{{ $all_examples := index site.Data "event-schemas" "examples" }}
{{ range $example_name, $example := $all_examples }}
{{/* This is to allow the msgtype template to work. It lets callers specify exactly the name of the example they want */}} {{ if $desired_example_name }} {{ if eq $example_name $desired_example_name }} {{ partial "events/example" (dict "schema" $example "name" $example_name) }} {{ end }} {{/* If `$desired_example_name` is not given, we will include any example that is equal to the event name. Normally, this would be handled by the case below, but that case does not work if the event name includes a "$". */}} {{ else if eq $event_name $example_name }} {{ partial "events/example" (dict "schema" $example "name" $example_name) }} {{/* If `$desired_example_name` is not given, we will include any examples whose first part (before "$") matches the event name */}} {{ else }}
{{ $pieces := split $example_name "$" }} {{ $example_base_name := index $pieces 0 }} {{ if eq $event_name $example_base_name }} {{ partial "events/example" (dict "schema" $example "name" $example_name) }} {{ end }} {{ end }}{{ end }}
</details>
</section>1234567891011{{- /*
A modified version of the favicons.html partial in Docsy.
*/ -}}
{{- $ico := resources.Get "icons/favicon.ico" -}}{{- $svg := resources.Get "icons/favicon.svg" -}}
<link rel="shortcut icon" href="{{ $ico.RelPermalink }}"><link rel="icon" type="image/svg+xml" href="{{ $svg.RelPermalink }}">123456789101112131415161718192021222324252627282930{{- /*
Modified version of the footer/center.html partial of Docsy, adding "bottom" links on top of the copyright.
*/ -}}
{{ with .Site.Params.links -}} {{ with index . "bottom" -}} {{- partial "footer/links.html" . -}} {{ end -}}{{ end -}}
<div class="mt-2 mb-3">{{ partial "footer/copyright.html" . -}}</div>
{{ with .Site.Params.privacy_policy -}} <span class="ms-2"><a href="{{ . }}" target="_blank" rel="noopener">{{ T "footer_privacy_policy" }}</a></span>{{- end -}}
{{ if ne .Site.Params.ui.footer_about_disable nil -}} {{ warnf "Config parameter '.params.ui.footer_about_disable' is DEPRECATED, use '.params.ui.footer_about_enable' instead." -}}{{ end -}}
{{ if or .Site.Params.ui.footer_about_enable (eq .Site.Params.ui.footer_about_disable false) -}} {{ with .Site.GetPage "about" -}} <p class="td-footer__about mt-2"><a href="{{ .RelPermalink }}">{{ .Title }}</a></p> {{- end -}}{{ end -}}1234567891011121314151617181920212223242526272829303132333435363738{{- /*
A modified version of the head-css.html partial of Docsy, that adds a call to `resources.PostProcess`, allowing post-processing of the generated CSS to remove unused selectors.
*/ -}}
{{ $scssMain := "scss/main.scss" -}}{{ $css := resources.Get $scssMain | toCSS (dict "enableSourceMap" (not hugo.IsProduction)) -}}
{{/* NOTE: we only apply `postCSS` in production or for RTL languages. Thismakes it snappier to develop in Chrome, but it may look sub-optimal in otherbrowsers. */ -}}
{{ if eq .Site.Language.LanguageDirection "rtl" -}} {{ $css = $css | postCSS (dict "use" "autoprefixer rtlcss" "noMap" true) | resources.Copy (replace $scssMain "." ".rtl.") -}}{{ else if hugo.IsProduction -}} {{ $css = $css | postCSS -}}{{ end -}}
{{ if hugo.IsProduction -}} {{ $css = $css | minify | fingerprint | resources.PostProcess -}} <link rel="preload" href="{{ $css.RelPermalink }}" as="style" integrity="{{ $css.Data.Integrity }}" crossorigin="anonymous">{{ end -}}
{{ with $css -}} <link href="{{ .RelPermalink }}" rel="stylesheet" {{- with .Data.Integrity }} integrity="{{ . }}" crossorigin="anonymous"{{ end -}} >{{ else -}} {{ errorf "Resource not found or error building CSS: %s" $scssMain -}}{{ end -}}
{{- /**/ -}}1234567891011121314151617{{/*
This template is included at the end of each page's `<body>`.
We're using it here to highlight and scroll the ToC in the sidebar to match the place we are at in the document.
*/}}{{ $toc := resources.Get "js/toc.js" -}}<script defer src="{{ $toc.RelPermalink }}"></script>
{{- /* Load the versions script template, run and publish it */ -}}{{ with resources.Get "js/versions.template.js" }} {{ with resources.ExecuteAsTemplate "js/versions.js" $ . }} <script defer src="{{ .RelPermalink }}"></script> {{ end }}{{ end }}123456789101112131415161718{{/*
This template is included at the end of each page's `<head>`.
We're using it here to include the custom CSS for the Taper spec.
*/}}
{{/* Load the Inter font.
We load it from a local copy, which is downloaded from Google Fonts manually via a script: https://github.com/matrix-org/matrix-spec/tree/main/static/css/fonts*/}}{{ $inter := resources.Get "css/fonts/Inter.css" -}}<link rel="preload" href="{{ $inter.RelPermalink }}" as="style"><link rel="stylesheet" href="{{ $inter.RelPermalink }}">123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251/* Finds and returns all schema definitions for objects, including subschemas, * in a JSON schema. * * The input should be a dict containing: * * * `schema`: a dict containing a JSON schema. * * `anchor_base`: a prefix to add to the HTML anchors generated for each * object. If nil, no anchors are generated. * * `name`: optionally, a name to use for this schema in error/warning * messages. If left unset, the schema's `title` property is used (if * present). * * Assumes that "resolve-refs" and "resolve-allof" has already been called on * the input schema. * * Returns an array of all the JSON schema definitions with `type: object` found * by recursing through `schema` and inspecting any subschemas, and including * `schema` itself. * * The returned entries are based on the JSON schema definitions found by * recursing through the input `schema`, with the following differences: * * * If `anchor_base` is set, each object with a `title` and `properties` * is given an `anchor`, which is a string suitable for using as an html * anchor for that object schema. * * * With the *exception* of the top-level `schema` (if it is an object), * properties outside the following list are removed: * * * title * * properties * * additionalProperties * * patternProperties * * required * * enum * * anchor * * In particular, this means that examples are removed (typically examples * are not helpful for subschemas), which means that duplicate schemas can * be successfully eliminated. * * The returned array contains only unique objects (ie, if the same object is * referenced twice within `schema`, it will only be returned once). */
{{ $res := partial "resolve-additional-types-inner" (dict "schema" .schema "anchor_base" .anchor_base "name" (.name | default .schema.title | default "<untitled object>") "top_level" true) }}{{ return $res.objects }}
/* * A helper for the resolve-additional-types partial. * * Takes the same inputs as resolve-additional-types itself, except: * * `name` is mandatory. * * `top_level`, if set, indicates that this is the top-level object. * * Returns a dict containing: * * * `objects`: The array of object schema definitions. * * * `schema`: An updated copy of the `schema` input (eg, an `anchor` may be added). * If the input `schema` was itself an object that we should create a table for, * this will be the same as the first entry in `objects`. */{{ define "_partials/resolve-additional-types-inner" }} {{ $this_object := .schema }} {{ $anchor_base := .anchor_base }} {{ $name := .name }} {{ $top_level := .top_level }}
{{ $all_objects := slice }}
{{ if eq $this_object.type "object" }} /* Give this object an anchor, if it has a name and properties */ {{ if (and $anchor_base $this_object.title $this_object.properties) }} {{ $this_object = merge $this_object (dict "anchor" (printf "%s_%s" $anchor_base (anchorize $this_object.title))) }} {{ end }}
/* Add any nested objects referenced in this object's `additionalProperties` */ {{ if $this_object.additionalProperties }} {{ if reflect.IsMap $this_object.additionalProperties }} {{ $res := partial "get-additional-objects" (dict "this_object" $this_object.additionalProperties "all_objects" $all_objects "anchor_base" $anchor_base "name" (printf "%s.additional" $name) ) }} {{ $all_objects = $res.objects }}
/* Update the top-level schema with the updated subschemas for the additionalProperties */ {{ $this_object = merge $this_object (dict "additionalProperties" $res.schema) }} {{ end }} {{ end }}
/* Add any nested objects referenced in this object's `patternProperties` */ {{ if $this_object.patternProperties }} {{ $updated_pattern_properties := dict }} {{ range $pattern, $object := $this_object.patternProperties}} {{ $res := partial "get-additional-objects" (dict "this_object" $object "all_objects" $all_objects "anchor_base" $anchor_base "name" (printf "%s.pattern.%s" $name $pattern) ) }} {{ $all_objects = $res.objects }} {{ $updated_pattern_properties = merge $updated_pattern_properties (dict $pattern $res.schema) }} {{ end }}
/* Update the top-level schema with the updated subschemas for the patternProperties */ {{ $this_object = merge $this_object (dict "patternProperties" $updated_pattern_properties) }} {{ end }}
/* Add any nested objects referenced in this object's `properties` */ {{ if $this_object.properties }} {{ $updated_properties := dict }} {{ range $key, $property := $this_object.properties}} {{ $res := partial "get-additional-objects" (dict "this_object" $property "all_objects" $all_objects "anchor_base" $anchor_base "name" (printf "%s.%s" $name $key) ) }} {{ $all_objects = $res.objects }} {{ $updated_properties = merge $updated_properties (dict $key $res.schema) }} {{ end }}
/* Update the top-level schema with the updated subschemas for the regular properties */ {{ $this_object = merge $this_object (dict "properties" $updated_properties) }} {{ end }}
/* We'll want to create a table for `$this_object` itself if either: * * - The object has some regular properties (not just patternProperties or additionalProperties), or: * - It is the top-level object. (We use a special format of table for top-level objects that * only have patternProperties or additionalProperties) * * In those cases, prepend the updated schema for the top-level object onto the $all_objects array. * * We think about this last so that we can take advantage of any updates to the schema that happened * above (in particular, addition of `anchor` attributes). */ {{ if or $this_object.properties $top_level }} {{ $tmp := slice $this_object }} {{ if $all_objects }} {{ $tmp = $tmp | append $all_objects }} {{ end }} {{ $all_objects = $tmp }} {{ end }} {{ end }}
{{ if eq $this_object.type "array" }} /* Add any nested objects referenced in this object's `items` */ {{ if $this_object.items.anyOf }} {{ $updated_schemas := slice }} {{ range $idx, $item := $this_object.items.anyOf }} {{ $res := partial "get-additional-objects" (dict "this_object" $item "all_objects" $all_objects "anchor_base" $anchor_base "name" (printf "%s.items[%d]" $name $idx) ) }} {{ $all_objects = $res.objects }} {{ $updated_schemas = $updated_schemas | append $res.schema }} {{ end }} /* Update the top-level schema with the updated subschemas for the items */ {{ $this_object = merge $this_object (dict "items" (dict "anyOf" $updated_schemas)) }} {{ else if reflect.IsMap $this_object.items}} {{ $res := partial "get-additional-objects" (dict "this_object" $this_object.items "all_objects" $all_objects "anchor_base" $anchor_base "name" (printf "%s.items" $name) ) }} {{ $all_objects = $res.objects }} /* Update the top-level schema with the updated subschema for the items */ {{ $this_object = merge $this_object (dict "items" $res.schema) }} {{ else }} {{ errorf "%s is defined as an 'array' but lacks a valid 'items'" $name }} {{ end }} {{ end }}
/* Handle object schemas using the `oneOf` keyword * (https://json-schema.org/understanding-json-schema/reference/combining.html#oneof) */ {{ if $this_object.oneOf }} {{ $updated_items := slice }} {{ range $idx, $item := $this_object.oneOf }} {{ $res := partial "get-additional-objects" (dict "this_object" $item "all_objects" $all_objects "anchor_base" $anchor_base "name" (printf "%s.oneOf[%d]" $name $idx) ) }} {{ $all_objects = $res.objects }} {{ $updated_items = $updated_items | append $res.schema }} {{ end }}
/* Update the top-level schema with the updated subschemas for the items */ {{ $this_object = merge $this_object (dict "oneOf" $updated_items) }} {{ end }}
{{ return (dict "objects" (uniq $all_objects) "schema" $this_object ) }}{{ end }}
/* This actually makes the recursive call and adds the returned object schema definitions to the array. * * Input is a dict containing: * * `this_object`: a JSON schema object. * * `name`: a name to use for this object in error/warning messages. * * `anchor_base`: a prefix to add to the HTML anchors generated for each * object. If nil, no anchors are generated. * * `all_objects`: the array of object schema definitions so far. * * Returns a dict containing: * * `objects`: The array of object schema definitions. * * `schema`: An updated copy of the `schema` input (eg, an `anchor` may be added). */{{ define "_partials/get-additional-objects" }} /* .name is the name of the object for logging purposes */ {{ $name := .name }}
{{ $all_objects := .all_objects }}
{{ if not (reflect.IsMap .this_object) }} {{ errorf "Invalid call to partials/get-additional-objects: %s is not a map" $name .this_object }} {{ end }}
{{ $res := partial "resolve-additional-types-inner" (dict "schema" .this_object "anchor_base" .anchor_base "name" $name "top_level" false) }} {{ range $res.objects }} {{ $all_objects = $all_objects | append (partial "clean-object" .) }} {{ end }} {{ return (dict "objects" $all_objects "schema" $res.schema ) }}{{ end }}
/* Only copy the bits of the object that we actually care about. * This is needed for uniqify to work - otherwise objects that are the same * but with (for example) different examples will be considered different. */{{ define "_partials/clean-object" }} {{ return (dict "title" .title "properties" .properties "additionalProperties" .additionalProperties "patternProperties" .patternProperties "required" .required "enum" .enum "anchor" .anchor) }}{{ end }}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889{{/*
Resolves the `allOf` keyword (https://spec.openapis.org/oas/v3.1.0#composition-and-inheritance-polymorphism) recursively, given a JSON schema object.
`allOf` is used to support a kind of inheritance for JSON schema objects.
An object can reference a "parent" object using `allOf`, and it then inherits its parent's properties. If the same property is present in the child, then we use the child's version (the child overrides the parent).
Of course the parent can itself inherit from *its* parent, so we recurse to handle that.*/}}
{{ $ret := . }}{{ $original := . }}
{{ if reflect.IsSlice $original }} {{/* If it's a slice, just recurse. */}} {{ $ret = slice }}
{{ range $original }} {{ $resolved := partial "json-schema/resolve-allof" . }} {{ if reflect.IsSlice $resolved }} {{/* If $resolved is a slice, `append` will add the items of $resolved to $ret, but we want to add $resolved itself to $ret, so we always wrap it into another slice. */}} {{ $resolved = slice $resolved }} {{ end }} {{ $ret = $ret | append $resolved }} {{ end }}{{ else if reflect.IsMap $original }} {{ $ret = dict }}
{{/* We special-case 'required', and accumulate the values from all the 'allOf' entries (rather than simply overriding them). Start the accumulation here. */}} {{ $required := slice }} {{ with $original.required }} {{ $required = . }} {{ end }}
{{ with $original.allOf }} {{/* Merge each of the allOf entries. */}} {{ range . }} {{/* First, resolve allOf in child. */}} {{ $resolved := partial "json-schema/resolve-allof" . }}
{{ with $resolved.required }} {{ $required = union $required . }} {{ end }}
{{/* With merge, values from the second argument override those from the first argument. So this order will accumulate values from allOf items, allowing later ones to override earlier
Note also that `merge` does a *deep* merge - nested maps are also merged. (Slices are replaced though.) */}} {{ $ret = merge $ret $resolved }} {{ end }} {{ end }}
{{/* Finally, merge in the original, allowing the original to override allOf. */}} {{ range $key, $value := $original }} {{ if and (ne $key "allOf") (ne $key "required") }} {{ $resolved := partial "json-schema/resolve-allof" $value }} {{ $ret = merge $ret (dict $key $resolved) }} {{ end }} {{ end }}
{{ with $required }} {{ $ret = merge $ret (dict "required" .) }} {{ end }}{{ end }}
{{ return $ret }}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071{{/* Find examples in the given JSON schema.
Tries to find examples in the `examples` and `example` keys of the schema first.
If it doesn't succeed, iterates through the properties and subproperties to collect their examples, to merge them into a complete example for the whole object.
Parameter: the JSON schema to extract the examples from.
*/}}
{{ $this_object := . }}{{ $examples := slice }}
{{ if $this_object.examples }} {{/* This is an array of examples, we can just use it */}} {{ $examples = $this_object.examples }}{{ else if $this_object.example }} {{ $examples = slice $this_object.example }}{{ else }} {{/* Resolve the nested examples */}} {{ if eq $this_object.type "object" }} {{ $example := dict }}
{{ range $key, $property := $this_object.properties}} {{ $this_property_examples := partial "json-schema/resolve-examples" $property }} {{/* It would be too complex to handle several nested examples, just use the first one. */}} {{ with index $this_property_examples 0 }} {{ $example = merge (dict $key .) $example }} {{ end }} {{ end }}
{{/* Add the assembled example to the list if either (a) the example is non-empty, or (b) the object itself is meant to be empty (so an empty example is correct). */}} {{ if (or $example (not $this_object.properties)) }} {{ $examples = slice $example }} {{ end }}
{{ else if eq $this_object.type "array" }}
{{/* the "items" within an array can either be an object (where we have a list of items which match the schema), or a list (for tuple validation, where each item has a different schema).
TODO: support tuple validation here. */}} {{ if reflect.IsMap $this_object.items }} {{ $items_examples := partial "json-schema/resolve-examples" $this_object.items }} {{/* It would be too complex to handle several nested examples, just use the first one. */}} {{ with index $items_examples 0 }} {{ $examples = slice (slice .) }} {{ end }} {{ end }} {{ end }}
{{ end }}
{{ return $examples }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687{{/*
Resolves the `$ref` JSON schema keyword, by recursively replacing it with the object it points to, given:
* `schema`: the schema where the references should be resolved * `path`: the path of the file containing the schema
This template uses [`Scratch`](https://gohugo.io/functions/scratch/) rather than a normal `dict` because with `dict` you can't replace key values: https://discourse.gohugo.io/t/how-can-i-add-set-and-delete-keys-in-a-dictionary/29661
*/}}
{{ $schema := .schema }}{{ $path := .path}}
{{ $ret := $schema }}
{{ if reflect.IsMap $schema }}
{{ $scratch := newScratch }} {{ $scratch.Set "result_map" dict }}
{{ $ref_value := index $schema "$ref"}} {{ if $ref_value }} {{ $uri := urls.Parse $path }} {{ $ref_uri := urls.Parse $ref_value }} {{ $full_uri := $uri.ResolveReference $ref_uri }}
{{ $full_path := strings.TrimPrefix "/" $full_uri.Path }} {{/* Apparently Hugo doesn't give us a nice way to split the extension off a filename. */}} {{ $without_ext := replaceRE "\\.[^\\.]*$" "" $full_path }} {{ $pieces := split $without_ext "/" }}
{{ $ref := index site.Data $pieces }}
{{/* If there is a fragment, follow the JSON Pointer */}} {{ if $full_uri.Fragment }} {{ $fragment := strings.TrimPrefix "/" $full_uri.Fragment }} {{ $pieces := split $fragment "/" }} {{ $ref = index $ref $pieces }} {{ end }}
{{ $new_path := (path.Split $full_path).Dir}} {{ $result_map := partial "json-schema/resolve-refs" (dict "schema" $ref "path" $new_path)}} {{ if $result_map}} {{ $scratch.Set "result_map" $result_map }} {{ end }} {{ end }}
{{ range $key, $value := $schema }} {{ if ne $key "$ref" }} {{ $resolved := partial "json-schema/resolve-refs" (dict "schema" $value "path" $path) }} {{ $scratch.SetInMap "result_map" $key $resolved }} {{ end }} {{ end }}
{{ $ret = $scratch.Get "result_map" }}
{{ end }}
{{ if reflect.IsSlice $schema }}
{{ $result_slice := slice }}
{{ range $schema }} {{ $resolved := partial "json-schema/resolve-refs" (dict "schema" . "path" $path) }} {{ if reflect.IsSlice $resolved }} {{/* If $resolved is a slice, `append` will add the items of $resolved to $result_slice, but we want to add $resolved itself to $result_slice, so we wrap it into another slice. */}} {{ $resolved = slice $resolved }} {{ end }} {{ $result_slice = $result_slice | append $resolved }} {{ end }}
{{ $ret = $result_slice }}
{{ end }}
{{ return $ret }}123456789101112131415161718{{- /*
A version of the navbar-version-selector.html partial in Docsy, modified to read the versions from /versions.json.
*/ -}}
{{ $changelog := site.GetPage "changelog" }}{{ $pages := $changelog.RegularPages.ByDate.Reverse }}
<div class="dropdown"> <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> All Versions </a> <ul class="dropdown-menu" id="version-selector"> {{- /* The menu is built by versions.template.js */ -}} </ul></div>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102{{- /*
A copy of the navbar.html partial in Docsy, modified to:
* replace the site title with "specification" at L31. * include the spec version from the config at L34-35, which is calculated using an inline `version-string` partial.
*/ -}}
{{ $cover := and (.HasShortcode "blocks/cover") (not .Site.Params.ui.navbar_translucent_over_cover_disable)-}}{{ $baseURL := urls.Parse $.Site.Params.Baseurl -}}
<nav class="td-navbar js-navbar-scroll {{- if $cover }} td-navbar-cover td-navbar-transparent {{- end }}" {{- if eq (.Param "ui.navbar_theme") "dark" }} data-bs-theme="dark" {{- end }}><div class="td-navbar-container container-fluid flex-column flex-md-row"> <a class="navbar-brand" href="{{ .Site.Home.RelPermalink }}"> {{- /**/ -}} <span class="navbar-brand__logo navbar-logo"> {{- if ne .Site.Params.ui.navbar_logo false -}} {{ with resources.Get "icons/logo.svg" -}} {{ ( . | minify).Content | safeHTML -}} {{ end -}} {{ end -}} </span> {{- /**/ -}} <span class="navbar-brand__name"> specification </span> {{- /**/ -}} <span class="navbar-version"> — {{ partial "version-string" . }}</span> {{- /**/ -}} </a> <div class="td-navbar__main td-navbar-nav-scroll td-navbar-nav-scroll--indicator" id="main_navbar"> <div class="scroll-indicator scroll-left"></div> <ul class="navbar-nav"> {{ $p := . -}} {{ range .Site.Menus.main -}} <li class="nav-item"> {{ $active := or ($p.IsMenuCurrent "main" .) ($p.HasMenuCurrent "main" .) -}} {{ $href := "" -}} {{ with .Page -}} {{ $active = or $active ( $.IsDescendant .) -}} {{ $href = .RelPermalink -}} {{ else -}} {{ $href = .URL | relLangURL -}} {{ end -}} {{ $isExternal := ne $baseURL.Host (urls.Parse .URL).Host -}} <a {{/**/ -}} class="nav-link {{- if $active }} active {{- end }}" {{/**/ -}} href="{{ $href }}" {{- if $isExternal }} target="_blank" rel="noopener" {{- end -}} > {{- .Pre -}} <span>{{ .Name }}</span> {{- .Post -}} </a> </li> {{ end -}} {{ if .Site.Params.versions -}} <li class="nav-item dropdown d-none d-lg-block td-navbar__version-menu"> {{ partial "navbar-version-selector.html" . -}} </li> {{ end -}} {{ if (gt (len .Site.Home.Translations) 0) -}} <li class="nav-item td-navbar__lang-menu"> {{ partial "navbar-lang-selector.html" . -}} </li> {{ end -}} {{- $darkMode := partialCached "dark-mode-config.html" "dark-mode-global" -}} {{ if $darkMode.showMenu -}} <li class="nav-item td-navbar__light-dark-menu"> {{ partial "theme-toggler" . }} </li> {{ end -}} </ul> <div class="scroll-indicator scroll-right"></div> </div> <div class="td-navbar__search d-none d-lg-block"> {{ partial "search-input.html" . }} </div></div></nav>
{{- define "_partials/version-string" -}} {{ $ret := "unstable version" -}}
{{ $status := .Site.Params.version.status -}}
{{ if ne $status "unstable" -}} {{ $path := path.Join "changelogs" -}}
{{/* produces a string similar to "version v1.5" */ -}} {{ $ret = delimit (slice "version v" .Site.Params.version.major "." .Site.Params.version.minor) "" -}} {{ end -}}
{{ return $ret -}}{{- end -}}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859{{/*
Render an HTTP API, given:
* `api_data`: the OpenAPI data * `base_url`: the base URL: that is, the part we glue onto the front of each value in `paths` to get a complete URL. * `anchor_base`: an optional prefix for the HTML IDs generated by this template. * `page`: the (Hugo) Page object to store endpoint metadata in the Scratch of. Used to build the endpoints TOC. * `module`: the current CS API module name, if any. Used to group endpoints in the TOC.
This template replaces the old {{*_http_api}} template.
*/}}
{{ $api_data := index .api_data }}{{ $base_url := .base_url }}{{ $anchor_base := .anchor_base }}{{ $page := .page }}{{ $module := .module }}
{{ range $path_name, $path_data := $api_data.paths }}
{{ $endpoint := delimit (slice $base_url $path_name ) "" }}
{{/* note that a `paths` entry can be a $ref */}}
{{ $params := dict "endpoint" $endpoint }}
{{ with $path_data.get }}
{{ $operation_params := merge $params (dict "method" "GET" "operation_data" . "anchor_base" $anchor_base "page" $page "module" $module) }} {{ partial "openapi/render-operation" $operation_params }}
{{ end }}
{{ with $path_data.post }}
{{ $operation_params := merge $params (dict "method" "POST" "operation_data" . "anchor_base" $anchor_base "page" $page "module" $module) }} {{ partial "openapi/render-operation" $operation_params }}
{{ end }}
{{ with $path_data.put }}
{{ $operation_params := merge $params (dict "method" "PUT" "operation_data" . "anchor_base" $anchor_base "page" $page "module" $module) }} {{ partial "openapi/render-operation" $operation_params }}
{{ end }}
{{ with $path_data.delete }}
{{ $operation_params := merge $params (dict "method" "DELETE" "operation_data" . "anchor_base" $anchor_base "page" $page "module" $module) }} {{ partial "openapi/render-operation" $operation_params }}
{{ end }}
{{ end }}12345678910111213141516171819202122232425262728293031323334353637{{/*
Render a table showing content types and their descriptions, given:
* `content_types`: OpenAPI data specifying the content types as a dictionary of the form {string: {"schema": JsonSchema}}
*/}}
{{ $content_types := .content_types }}
{{ if (gt (len $content_types) 0) }}
<table class="content-type-table"> <thead> <tr> <th class="col-name">Content-Type</th> <th class="col-description">Description</th> </tr> </thead> {{ range $mime, $body := $content_types }} <tr> <td><code>{{ $mime }}</code></td> <td> {{/* Force the rendering as a block so the description is always inside a paragraph. This allows to always keep the same spacing between paragraphs when adding added-in and changed-in paragraphs. */}} {{ $body.schema.description | page.RenderString (dict "display" "block") -}} {{ if (index $body.schema "x-addedInMatrixVersion") }}{{ partial "added-in" (dict "v" (index $body.schema "x-addedInMatrixVersion")) }}{{ end -}} {{ if (index $body.schema "x-changedInMatrixVersion") }}{{ partial "changed-in" (dict "changes_dict" (index $body.schema "x-changedInMatrixVersion")) }}{{ end -}} </td> </tr> {{ end }}</table>
{{ end }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104{{/*
Render a map of [Media Type Objects](https://spec.openapis.org/oas/v3.1.1#media-type-object). This map can be found as the `content` field of requests and responses.
Parameters:
* `content`: A map of MIME type to Media Type Object * `kind`: the kind of object that is rendered, either `request` or `response`. * `anchor_base`: a prefix to add to the HTML anchors generated for each object
This template renders:
* Object tables if the map contains an `application/json` MIME type, or a table with the MIME types and the corresponding description of the object. * The examples of the Media Type Objects.
*/}}
{{/* Request and response bodies can have several content types. If there is a JSON type, we display that; otherwise we just show the content types and descriptions.*/}}{{ $json_body := index .content "application/json" }}{{ if $json_body }} {{/* Display the JSON schemas */}}
{{ $schema := $json_body.schema }}
{{/* All this is to work out how to express the content of the response in the case where it is an array. */}} {{ if eq $schema.type "array" }} {{ $type_of := "" }} {{ if $schema.items.anyOf }} {{ $types := slice }} {{ range $schema.items.anyOf }} {{ if .title }} {{ $types = $types | append .title}} {{ else }} {{ $types = $types | append .type }} {{ end }} {{ end }} {{ $type_of = delimit $types ", "}} {{ else }} {{ $type_of = $schema.items.title }} {{ end }}<p>Array of <code>{{ $type_of }}</code>.</p> {{ end }}
{{/* Render object tables for any objects referenced in the request/response. This will be a no-op for request/response body types which aren't objects or arrays. */}} {{ $additional_types := partial "json-schema/resolve-additional-types" (dict "schema" $schema "anchor_base" .anchor_base) }} {{ range $additional_types }} {{ partial "openapi/render-object-table" . }} {{ end }}{{ else }} {{/* Show the content types and description. */}} {{ partial "openapi/render-content-type" (dict "content_types" .content) }}{{ end }}
{{/* Show all the examples.*/}}{{ if eq .kind "request" }}<h3>Request body example</h3>{{ end }}
{{ range $mime, $body := .content }} {{ $examples := slice }}
{{/* Find the examples to display, with the following priority:
1. The `examples` field 2. The `example` field 3. The examples in the `schema` field */}} {{ if $body.examples }} {{/* This is a map of string to Example Object */}} {{ range $key, $example := $body.examples }} {{/* The example is in the `value` field of the object */}} {{ $examples = $examples | append (slice $example.value) }} {{ end }} {{ else if $body.example }} {{ $examples = slice $body.example }} {{ else if $body.schema }} {{ $examples = partial "json-schema/resolve-examples" $body.schema }} {{ end }}
{{ range $examples }} {{ partial "render-example" (dict "example" . "mime" $mime) }} {{ end }}{{ end }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342{{/*
Render a table listing the properties of an object, given:
* `title`: optional caption for the table
* `anchor`: optional HTML element id for the table
* `properties`: optional dictionary of the properties to list, each given as: `property_name` : `property_data`
* `additionalProperties`: a JSON Schema for additional properties on the object.
* `patternProperties`: optional dictionary for properties with names adhering to a regex pattern. A map from regex pattern to JSON Schema.
* `required`: optional array containing the names of required properties. In some cases (such as response body specifications) this isn't used, and instead properties have a `required` boolean attribute. We support this too.
*/}}
{{ $title := .title }}{{ $properties := .properties}}{{ $required := .required}}
{{ if $properties }}<table{{ if .anchor }} id="{{ .anchor }}"{{ end }} class="object-table"> {{ with $title }} <caption>{{ . }}</caption> {{ end }} <thead> <tr> <th class="col-name">Name</th> <th class="col-type">Type</th> <th class="col-description">Description</th> </tr> </thead>
{{ range $property_name, $property := $properties }} {{/* Handle two ways of indicating "required", one for simple parameters, the other for request and response body objects. */}} {{ $required := cond (or (in $required $property_name) ( eq $property.required true )) true false }}
<tr> <td><code>{{ $property_name }}</code></td> <td><code>{{ partial "property-type" $property | safeHTML }}</code></td> <td>{{ partial "property-description" (dict "property" $property "required" $required) }}</td> </tr>
{{ end }}
{{/* If the object has additional properties *as well as* regular properties, we add a special row to the table.
Note that, per https://json-schema.org/draft/2020-12/json-schema-core#name-boolean-json-schemas, JSON schemas can be a simple "true" or "false" as well as the more normal object.
`additionalProperties: true` is pretty much the default for Taper (it means: "you're allowed to include random unspecced properties in your object"), so nothing to do here.
`additionalProperties: false` means "you're not allowed to include any unspecced properties in your object". We may want to consider how to display that; for now we just ignore it.
TODO: support `patternProperties` here. */}} {{ if reflect.IsMap .additionalProperties }}
<tr> <td><Other properties></td> <td><code>{{ partial "property-type" .additionalProperties | safeHTML }}</code></td> <td>{{ partial "property-description" (dict "property" .additionalProperties) }}</td> </tr> {{ end }}</table>
{{ else if (or .additionalProperties .patternProperties) }}
{{/*A special format of table for objects which only have additionalProperties or patternProperties.
This is only ever used for top-level objects. Nested objects in this situation are just shownas rows within their parent object, and don't get their own table. (They are filtered out inresolve-additional-types.)*/}}
<table{{ if .anchor }} id="{{ .anchor }}"{{ end }} class="object-table"> {{ with $title }} <caption>{{ . }}</caption> {{ end }} <thead> <tr> <th class="col-type">Type</th> <th class="col-description">Description</th> </tr> </thead>
{{ $property := . }}
<tr> <td><code>{{ partial "property-type" $property | safeHTML }}</code></td> <td>{{ partial "property-description" (dict "property" $property) }}</td> </tr></table>
{{ end }}
{{/* Computes the type to display for a property's schema, given:
* `type`: optional string or array of strings for the type(s) of the property
* `title`: optional string for the title of the property
* `oneOf`: optional array of dictionaries describing the different formats that the property can have * `anyOf`: optional array of dictionaries describing the different formats that the property can have
* `properties`: if the type is an object, optional dictionary for well-defined properties, each given as: `property_name` : `property_data`
* `additionalProperties`: if the type is an object, optional dictionary for properties with undefined names
* `patternProperties`: if the type is an object, optional dictionary for properties with names adhering to a regex pattern
* `items`: if the type is an array, array of dictionaries describing the format of the array's items
* `anchor`: optional HTML element id for the target type, which will be used to link to it.
* `format`: optional string for the format of the type, used for strings.
*/}}{{ define "_partials/property-type" }} {{ $type := "" }}
{{ if eq .type "object" }} {{/* Resolve the type or title of the object */}} {{ $type = partial "object-type-or-title" . }} {{ else if eq .type "array"}} {{/* If the property is an array, indicate this with square brackets, like `[type]`. */}} {{ $items := .items }} {{ $inner_type := partial "property-type" $items }} {{ $type = delimit (slice "[" $inner_type "]") "" }} {{ else if eq .type "string" }} {{ $type = "string" }}
{{/* If the string uses a known format, use it. */}} {{ with .format }} {{ with partial "string-format" . }} {{ $type = . }} {{ end }} {{ end }} {{ else if or (reflect.IsSlice .type) .oneOf .anyOf }} {{/* It's legal to specify an array of types.
There are three ways to do that: - Use an array of strings. - Use oneOf, with items having a schema. - Use anyOf, with items having a schema.
Join them together in that case, like `type|other_type`. */}} {{ $types := slice }}
{{ if .oneOf }} {{ range .oneOf }} {{ $types = $types | append (partial "property-type" .) }} {{ end }} {{ else if .anyOf }} {{ range .anyOf }} {{ $types = $types | append (partial "property-type" .) }} {{ end }} {{ else }} {{ range .type }} {{ $types = $types | append (htmlEscape .) }} {{ end }} {{ end }}
{{ $type = delimit $types "|" }} {{ else }} {{/* A simple type like integer or boolean */}} {{ $type = (htmlEscape .type) }} {{ end }}
{{ return $type }}{{ end }}
{{/* Computes the type to display for an object property's schema, given:
* `type`: string equal to "object"
* `title`: optional string for the title of the object property
* `properties`: optional dictionary for well-defined properties, each given as: `property_name` : `property_data`
* `additionalProperties`: optional dictionary for properties with undefined names
* `patternProperties`: optional dictionary for properties with names adhering to a regex pattern
* `anchor`: optional HTML element id for the target type, which will be used to link to it.*/}}{{ define "_partials/object-type-or-title" }} {{ $type := "object" }} {{ if .properties }} {{/* The object has its own (regular) properties, so we will make a separate table for it. Refer to it using its title, if it has one. */}} {{ if .title }} {{ $type = .title | htmlEscape }} {{ if .anchor }} {{ $type = printf "<a href=\"#%s\">%s</a>" (htmlEscape .anchor) $type }} {{ end }} {{ end }} {{ else if reflect.IsMap .additionalProperties }} {{/* If the property uses `additionalProperties` to describe its internal structure, handle this with a bit of recursion */}} {{ $type = delimit (slice "{string: " (partial "property-type" .additionalProperties) "}" ) "" }} {{ else if reflect.IsMap .patternProperties }} {{/* If the property uses `patternProperties` to describe its internal structure, handle this with a bit of recursion. Types are grouped by pattern format. Note that we ignore patterns without a format as the current definitions always have a single pattern, but we might need to handle them later to differentiate schemas according to patterns. */}}
{{/* Construct a map from format ID to the type string of the format. */}} {{ $formatMap := newScratch }}
{{ range $pattern, $schema := .patternProperties }} {{ $formatId := or (index $schema "x-pattern-format") "string" }}
{{ if $formatMap.Get $formatId }} {{ errorf "'%s' pattern format is defined more than once for the same property" $formatId }} {{ end }}
{{ $formatMap.Set $formatId (partial "property-type" $schema) }} {{ end }}
{{/* First generate the type string for each format. */}} {{ $types := slice }} {{ range $formatId, $formatType := $formatMap.Values }} {{ $formatKey := "string" }} {{ if ne $formatId "string" }} {{ with partial "string-format" $formatId }} {{ $formatKey = . }} {{ else }} {{ errorf "Unsupported value for `x-pattern-format`: %s" $formatId }} {{ end }} {{ end }}
{{ $formatString := printf "{%s: %s}" $formatKey $formatType }} {{ $types = $types | append $formatString }} {{ end }}
{{/* Then join all the formats. */}} {{ $type = delimit $types "|" }} {{ else if .title }} {{/* No properties, so there won't be a separate table. We use the title anyway, because showing the title (like `EventFilter`) is better than showing `object`. */}} {{ $type = .title | htmlEscape }} {{ end }}
{{ return $type }}{{ end }}
{{/* Computes the description to display for a property, given:
* `required`: boolean indicating whether this property is required.
* `property`: dictionary describing the property's data, with these fields:
* `description`: string describing the property
* `enum`: optional array indicating the accepted values for the property
* `x-addedInMatrixVersion`: optional string indicating in which Taper spec version this property was added.
* `x-changedInMatrixVersion`: optional string indicating in which Taper spec version this property was last changed.*/}}{{ define "_partials/property-description" -}} {{ $description := .property.description -}} {{ if .required -}} {{/* Prepend "Required:" to make it part of the first paragraph of the description. */}} {{- $description = printf "<strong>Required: </strong>%s" (default "" $description) -}} {{ end -}} {{/* Force the rendering as a block so the description is always inside a paragraph. This allows to always keep the same spacing between paragraphs when adding added-in and changed-in paragraphs. */}} {{ $description | page.RenderString (dict "display" "block") -}} {{ if .property.enum }}<p>One of: <code>[{{ delimit .property.enum ", " }}]</code>.</p>{{ end -}} {{ if (index .property "x-addedInMatrixVersion") }}{{ partial "added-in" (dict "v" (index .property "x-addedInMatrixVersion")) }}{{ end -}} {{ if (index .property "x-changedInMatrixVersion") }}{{ partial "changed-in" (dict "changes_dict" (index .property "x-changedInMatrixVersion")) }}{{ end -}}{{ end }}
{{/* Computes the type to display for a string format, given the identifier of the format as a string.*/}} {{ define "_partials/string-format" }} {{ $stringFormat := "" }}
{{ with index site.Data "string-formats" . }} {{ $stringFormat = printf "<a href=\"%s\">%s</a>" (htmlEscape .url | relURL) (htmlEscape .title) }} {{ end }}
{{ return $stringFormat }}{{ end }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120{{/*
Render a single HTTP API operation: that is, a method+endpoint combination, given:
* `method`: the method, e.g. GET, PUT * `endpoint`: the endpoint * `operation_data`: the OpenAPI data for the operation * `anchor_base`: an optional prefix for the HTML IDs generated by this template. * `page`: the (Hugo) Page object to store endpoint metadata in the Scratch of. Used to build the endpoints TOC. * `module`: the current CS API module name, if any. Used to group endpoints in the TOC.
This template renders the operation as a `<section>` containing:
* an `<h1>` heading containing the method and endpoint * a `<details>` element containing the details, including: * operation description * basic info about the operation * request details * response details
*/}}
{{ $method := .method }}{{ $endpoint := .endpoint }}{{ $operation_data := .operation_data }}{{ $page := .page }}{{ $module := .module }}
{{ $anchor := "" }}{{ if .anchor_base }} {{ $anchor = printf "%s_" .anchor_base }}{{ end }}{{ $anchor = printf "%s%s%s" $anchor (lower $method) (anchorize $endpoint) }}
{{/* Collect endpoints for the on-page endpoints TOC */}}{{ if $page }} {{/* Store each endpoint's metadata in a scratch variable */}} {{ $entry := dict "anchor" $anchor "method" $method "endpoint" $endpoint "summary" $operation_data.summary "deprecated" $operation_data.deprecated "module" $module }} {{ if not ($page.Scratch.Get "api_endpoints_seen") }} {{ $page.Scratch.Set "api_endpoints_seen" dict }} {{ end }} {{/* Keep a map of seen endpoints. This is necessary as this partial may be rendered multiple times for the same endpoint (e.g. in the TOC and in the main content), leading to duplicates. */}} {{ $seen := $page.Scratch.Get "api_endpoints_seen" }} {{ $key := printf "%s|%s" $method $endpoint }} {{ if not (index $seen $key) }} {{ if not (reflect.IsSlice ($page.Scratch.Get "api_endpoints")) }} {{ $page.Scratch.Set "api_endpoints" (slice) }} {{ end }} {{ $page.Scratch.Add "api_endpoints" (slice $entry) }} {{ $page.Scratch.SetInMap "api_endpoints_seen" $key true }} {{ end }}{{ end }}
<section class="rendered-data">
<details {{ if not site.Params.ui.rendered_data_collapsed }}open{{ end }}><summary>
<h1 id="{{ $anchor }}"> <span class="http-api-method">{{ $method }}</span> <span class="endpoint{{ if $operation_data.deprecated }} deprecated-inline{{ end }}">{{ $endpoint }}</span> {{ partial "td/heading-self-link.html" (dict "Anchor" $anchor) }} </h1></summary>
<hr>
{{ if $operation_data.deprecated }} {{ partial "alert" (dict "type" "warning" "omit_title" "true" "content" "This API is deprecated and will be removed from a future release.") }}{{ end }}
{{ if (index $operation_data "x-addedInMatrixVersion") }} {{ partial "added-in" (dict "v" (index $operation_data "x-addedInMatrixVersion")) }}{{ end }}{{ if (index $operation_data "x-changedInMatrixVersion") }} {{ partial "changed-in" (dict "changes_dict" (index $operation_data "x-changedInMatrixVersion")) }}{{ end -}}
{{ $operation_data.description | page.RenderString (dict "display" "block") }}
<table class="basic-info"> <tr> <th>Rate-limited:</th> {{ $rate_limited := index $operation_data.responses "429" }} <td>{{ if $rate_limited }}Yes{{ else }}No{{ end }}</td> </tr> <tr> <th>Requires authentication:</th> {{/* Authentication is defined with the `security` key. We assume that the key is not set if no authentication is necessary. If the key is set, authentication is required unless it contains an item that is an empty object. */}} {{ $requires_authentication := "Yes" }} {{ if $operation_data.security }} {{ range $operation_data.security }} {{ if eq (len (index $operation_data.security 0)) 0 }} {{ $requires_authentication = "Optional" }} {{ end }} {{ end }} {{ else }} {{ $requires_authentication = "No" }} {{ end }} <td>{{ $requires_authentication }}</td> </tr></table>
<hr>{{ partial "openapi/render-request" (dict "parameters" $operation_data.parameters "request_body" $operation_data.requestBody "anchor_base" $anchor ) }}<hr>{{ partial "openapi/render-responses" (dict "responses" $operation_data.responses "anchor_base" $anchor ) }}
</details>
</section>1234567891011121314151617181920212223242526272829303132333435{{/*
Render the parameters of a given type, given:
* `parameters`: OpenAPI data specifying the parameters * `type`: the type of parameters to render: "header, ""path", "query" * `caption`: caption to use for the table
This template renders a single table containing parameters of the given type.
*/}}
{{ $parameters := .parameters }}{{ $type := .type }}{{ $caption := .caption }}
{{ $parameters_of_type := where $parameters "in" $type }}
{{ with $parameters_of_type }}
{{/* build a dict mapping from name->parameter, which render-object-table expects */}} {{ $param_dict := dict }} {{ range $parameter := . }} {{/* merge the schema at the same level as the rest of the other fields because that is what `render-object-table` expects. Put the schema first so examples in it are overwritten. */}} {{ $param := merge $parameter.schema $parameter }} {{ $param_dict = merge $param_dict (dict $parameter.name $param )}} {{ end }}
{{/* and render the parameters */}} {{ partial "openapi/render-object-table" (dict "title" $caption "properties" $param_dict) }}{{ end }}123456789101112131415161718192021222324252627282930313233343536373839404142{{/*
Render the request part of a single HTTP API operation, given:
* `parameters`: OpenAPI data specifying the parameters * `request_body`: OpenAPI data specifying the request body * `anchor_base`: a prefix to add to the HTML anchors generated for each object
This template renders: * the "simple parameters" (header, path, query parameters) * body parameters, which may be more complex, containing nested objects * response body examples
*/}}
{{ $parameters := .parameters }}{{ $request_body := .request_body }}{{ $anchor_base := .anchor_base }}{{ $anchor := printf "%s_request" $anchor_base }}
<h2>Request</h2>
{{ if or $parameters $request_body }}
{{ if $parameters }}<h3>Request parameters</h3>
{{ partial "openapi/render-parameters" (dict "parameters" $parameters "type" "header" "caption" "header parameters") }} {{ partial "openapi/render-parameters" (dict "parameters" $parameters "type" "path" "caption" "path parameters") }} {{ partial "openapi/render-parameters" (dict "parameters" $parameters "type" "query" "caption" "query parameters") }}
{{ end }}
{{ if $request_body }}<h3>Request body</h3>
{{ partial "openapi/render-media-type-objects" (dict "content" $request_body.content "kind" "request" "anchor_base" $anchor) }} {{ end }}
{{ else }}<p>No request parameters or request body.</p>{{ end }}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364{{/*
Render the response part of a single HTTP API operation, given:
* `responses`: OpenAPI data specifying the responses * `anchor_base`: a prefix to add to the HTML anchors generated for each object
This template renders: * a summary of all the different responses * details of the body for each response code * body parameters, which may be more complex, containing nested objects * response body examples
*/}}
{{ $responses := .responses }}{{ $anchor_base := .anchor_base }}
<h2>Responses</h2>
<table class="response-table"> <thead> <tr> <th class="col-status">Status</th> <th class="col-status-description">Description</th> </tr> </thead>
{{ range $code, $response := $responses }}
<tr> <td><code>{{ $code }}</code></td> <td>{{ $response.description | markdownify }}</td> </tr>
{{ end }}
</table>
{{ range $code, $response := $responses }} {{ if $response.content }} {{ $anchor := printf "%s_response-%s" $anchor_base $code }}<h3>{{$code}} response</h3> {{/* Display defined headers */}} {{ if $response.headers }} {{/* build a dict mapping from name->schema, which render-object-table expects */}} {{ $headers_dict := dict }} {{ range $header_name,$header_props := $response.headers }} {{/* merge the schema at the same level as the rest of the other fields because that is what `render-object-table` expects. Put the schema first so examples in it are overwritten. */}} {{ $header_schema := merge $header_props.schema $header_props }} {{ $headers_dict = merge $headers_dict (dict $header_name $header_schema )}} {{ end }}
{{/* and render the headers */}} {{ partial "openapi/render-object-table" (dict "title" "Headers" "properties" $headers_dict) }} {{ end }}
{{ partial "openapi/render-media-type-objects" (dict "content" $response.content "kind" "response" "anchor_base" $anchor) }} {{ end }}{{ end }}12345678910111213141516171819202122232425262728293031323334353637383940{{/*
Renders an example to be included in HTML, with support for pretty-printing JSON.
Parameters:
* `example`: the example * `mime`: the mime type of the example. Used to pretty-print JSON and for syntax highlighting. If it is not provided, it is assumed to be `application/json`.
*/}}
{{ $example := .example }}
{{/* We need to convert the mime type to a recognized language. For simplicity we only support JSON, which is also the default. Other mime types are not highlighted.*/}}{{ $language := "json" }}
{{ if (and .mime (ne .mime "application/json")) }} {{/* `no-highlight` treats the value as plain text, but still styles the code block like the ones with proper syntax highlighting. */}} {{ $language = "no-highlight" }}{{ end }}
{{ if eq $language "json" }} {{ $example = jsonify (dict "indent" " ") $example }} {{ $example = replace $example "\\u003c" "<" }} {{ $example = replace $example "\\u003e" ">" }}{{ end }}
```{{ $language }}{{ $example | safeHTML }}```12345678910<div class="td-search td-search--offline"> <div class="td-search__icon"></div> <input type="search" class="td-search__input form-control" placeholder="Search the spec" aria-label="Search the spec" autocomplete="off" ></div>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194{{- /*
A copy of the siderbar-tree.html partial in Docsy, modified to:
* Ignore the `sidebarRoot` parameter, because of this regression: <https://github.com/google/docsy/issues/2426> * Add the "toc.html" partial at L68.
*/ -}}
{{ $context := .context -}}{{ $sidebarRoot := .sidebarRoot -}}{{ $sidebarRootID := .sidebarRootID -}}{{ $cacheSidebar := .cacheSidebar -}}
{{ with $context -}}
{{/* When the sidebar is cached, "active" class is set client side. */ -}}{{ $shouldDelayActive := $cacheSidebar -}}
<div id="td-sidebar-menu" class="td-sidebar__inner{{ if $shouldDelayActive }} d-none{{ end }}"> {{ if not .Site.Params.ui.sidebar_search_disable -}}
<form class="td-sidebar__search d-flex align-items-center"> {{ partial "search-input.html" . }} <button class="btn btn-link td-sidebar__toggle" type="button" {{/**/ -}} data-bs-toggle="collapse" data-bs-target="#td-section-nav" {{/**/ -}} aria-controls="td-section-nav" aria-expanded="false" aria-label="Toggle section navigation"> </button> </form>
{{- else -}}
<div id="content-mobile"> <form class="td-sidebar__search d-flex align-items-center"> {{ partial "search-input.html" . }} <button class="btn btn-link td-sidebar__toggle" type="button" {{/**/ -}} data-bs-toggle="collapse" data-bs-target="#td-section-nav" {{/**/ -}} aria-controls="td-section-nav" aria-expanded="false" aria-label="Toggle section navigation"> </button> </form> </div> <div id="content-desktop"></div>
{{- end }} {{/* */ -}}
<nav class="td-sidebar-nav collapse {{- if .Site.Params.ui.sidebar_search_disable }} td-sidebar-nav--search-disabled{{ end -}} {{- if .Site.Params.ui.sidebar_menu_foldable }} foldable-nav{{ end }}" {{/**/ -}} id="td-section-nav" {{- if .Site.Params.ui.sidebar_root_enabled }} data-sidebar-root-id="{{ $sidebarRootID }}"{{ end -}} > {{ if and .Site.Params.ui.sidebar_lang_menu (gt (len .Site.Home.Translations) 0) -}} <div class="td-sidebar-nav__section nav-item d-block d-lg-none"> {{ partial "navbar-lang-selector.html" . }} </div> {{ end -}} {{ $navRoot := cond (and (ne .Params.toc_root true) (eq .Site.Home.Type "docs")) .Site.Home .FirstSection -}} {{ $ulNr := 0 -}} {{ $ulShow := .Site.Params.ui.ul_show | default 1 -}} {{ $sidebarMenuTruncate := .Site.Params.ui.sidebar_menu_truncate | default 100 -}} <ul class="td-sidebar-nav__section pe-md-3 ul-{{ $ulNr }}"> {{ template "section-tree-nav-section" (dict "page" . "section" $navRoot "shouldDelayActive" $shouldDelayActive "sidebarMenuTruncate" $sidebarMenuTruncate "ulNr" $ulNr "ulShow" (add $ulShow 1)) }} </ul> {{ partial "toc.html" . }} </nav></div>
{{- end }}{{/* with $context */ -}}
{{ define "section-tree-nav-section" -}} {{/* cSpell:ignore manuallink manuallinkrelref manuallinktitle */ -}} {{ $s := .section -}} {{ $p := .page -}} {{ $shouldDelayActive := .shouldDelayActive -}} {{ $sidebarMenuTruncate := .sidebarMenuTruncate -}} {{ $treeRoot := cond (eq .ulNr 0) true false -}} {{ $ulNr := .ulNr -}} {{ $ulShow := .ulShow -}} {{ $active := and (not $shouldDelayActive) (eq $s $p) -}} {{ $activePath := and (not $shouldDelayActive) (or (eq $p $s) ($p.IsDescendant $s)) -}} {{ $show := cond (or (lt $ulNr $ulShow) $activePath (and (not $shouldDelayActive) (eq $s.Parent $p.Parent)) (and (not $shouldDelayActive) (eq $s.Parent $p)) (not $p.Site.Params.ui.sidebar_menu_compact) (and (not $shouldDelayActive) ($p.IsDescendant $s.Parent)) ) true false -}} {{ $mid := printf "m-%s" ($s.RelPermalink | anchorize) -}} {{ $pages_tmp := where (union $s.Pages $s.Sections).ByWeight ".Params.toc_hide" "!=" true -}} {{ $pages := $pages_tmp | first $sidebarMenuTruncate -}} {{ $truncatedEntryCount := sub (len $pages_tmp) $sidebarMenuTruncate -}}
{{ if gt $truncatedEntryCount 0 -}} {{ warnf "WARNING: %d sidebar entries have been truncated. To avoid this, increase `params.ui.sidebar_menu_truncate` to at least %d (from %d) in your config file. Section: %s" $truncatedEntryCount (len $pages_tmp) $sidebarMenuTruncate $s.Path -}} {{ end -}}
{{ $withChild := gt (len $pages) 0 -}} {{ $manualLink := cond (isset $s.Params "manuallink") $s.Params.manualLink (cond (isset $s.Params "manuallinkrelref") (relref $s $s.Params.manualLinkRelref) $s.RelPermalink ) -}} {{ $manualLinkTitle := cond (isset $s.Params "manuallinktitle") $s.Params.manualLinkTitle $s.Title -}} {{ if and $treeRoot (eq $s.Params.sidebar_root_for "self") -}} {{ with $s.Parent -}} {{ $manualLink = .RelPermalink -}} {{ end -}} {{ end -}} <li class="td-sidebar-nav__section-title td-sidebar-nav__section {{- if $withChild }} with-child{{ else }} without-child{{ end -}} {{ if $activePath }} active-path{{ end -}} {{ if (not (or $show $p.Site.Params.ui.sidebar_menu_foldable )) }} collapse{{ end -}} " {{/**/ -}} id="{{ $mid }}-li" {{- /**/ -}} > {{ if (and $p.Site.Params.ui.sidebar_menu_foldable (ge $ulNr 1)) -}} <input type="checkbox" id="{{ $mid }}-check"{{ if $activePath}} checked{{ end }}/> <label for="{{ $mid }}-check">{{/**/ -}} <a href="{{ $manualLink }}" {{- if ne $s.LinkTitle $manualLinkTitle }} {{/**/ -}} title="{{ $manualLinkTitle }}" {{- end -}} {{ with $s.Params.manualLinkTarget }} {{/**/ -}} target="{{ . }}" {{- if eq . "_blank" }} rel="noopener"{{ end -}} {{ end }} {{/**/ -}} class="align-left ps-0 {{ if $active}} active{{ end }} td-sidebar-link {{- if $s.IsPage }} td-sidebar-link__page {{- else }} td-sidebar-link__section {{- end }} {{- if $treeRoot }} tree-root{{ end }}" {{/**/ -}} id="{{ $mid }}" {{- /**/ -}} > {{- with $s.Params.Icon -}} <i class="{{ . }}"></i> {{- end -}} <span class="{{ if $active }}td-sidebar-nav-active-item{{ end }}"> {{- $s.LinkTitle -}} </span> {{- /**/ -}} </a> {{- /**/ -}} </label> {{ else -}} <a href="{{ $manualLink }}" {{- if ne $s.LinkTitle $manualLinkTitle }} title="{{ $manualLinkTitle }}"{{ end -}} {{ with $s.Params.manualLinkTarget }} {{/**/ -}} target="{{ . }}" {{- if eq . "_blank" }} rel="noopener"{{ end -}} {{ end }} {{/**/ -}} class="align-left ps-0 {{- if $active}} active{{ end }} {{/**/ -}} td-sidebar-link {{- if $s.IsPage }} td-sidebar-link__page{{ else }} td-sidebar-link__section{{ end }} {{- if $treeRoot }} tree-root{{ end }}" {{/**/ -}} id="{{ $mid }}" {{- /**/ -}} > {{- with $s.Params.Icon -}} <i class="{{ . }}"></i> {{- end -}} <span class=" {{- if $active }}td-sidebar-nav-active-item{{ end -}} {{- if and $treeRoot $s.Params.sidebar_root_for site.Params.ui.sidebar_root_enabled }} td-sidebar-root-up-icon{{ end -}} "> {{- $s.LinkTitle -}} </span></a> {{- end -}} {{ if $withChild -}} {{ $ulNr := add $ulNr 1 }} <ul class="ul-{{ $ulNr }}{{ if (gt $ulNr 1)}} foldable{{end}}"> {{ range $pages -}} {{ if (not (and (eq $s $p.Site.Home) (eq .Params.toc_root true))) -}} {{ template "section-tree-nav-section" (dict "page" $p "section" . "shouldDelayActive" $shouldDelayActive "sidebarMenuTruncate" $sidebarMenuTruncate "ulNr" $ulNr "ulShow" $ulShow) }} {{- end }} {{- end }} </ul> {{- end }} </li>{{- end -}}1234567891011121314{{- /* Shared render for spec pages: title, optional description, endpoints list, body, and last-mod info. */ -}}<div class="td-content"> <h1>{{ .Title }}</h1> {{ with .Params.description }}<p class="page-description">{{ . | markdownify }}</p>{{ end }}
{{/* Render an endpoints table of contents. This is the main difference between our templates (which call the spec-content partial) and the default Docsy template. */}} {{ partial "endpoints-toc.html" . }}
{{ .Content }}</div>1234567891011121314151617181920212223242526272829{{/*
A copy of the toc.html partial in Docsy, modified to:
* show the page's title instead of "on this page"
*/ -}}
{{/*
Always render the td-toc element. ScrollSpy is counting on it to exist, even if it's empty.
cSpell:ignore notoc*/ -}}
<div class="td-toc" data-proofer-ignore>{{ if not .Params.notoc -}} {{ $toc := .TableOfContents -}} {{ if and $toc (ne $toc `<nav id="TableOfContents"></nav>`) -}} <div class="td-toc-title"> <span class="td-toc-title__text">{{ .Params.Title }}</span> <a class="td-toc-title__link" title="{{ i18n "toc_top_of_page" }}" href="#"></a> </div> {{ $toc | safeHTML }} {{ end -}}{{ end -}}</div>{{/* */ -}}12345678910111213141516171819202122{{/*
A modified version of the version-banner.html partial in Docsy.
*/}}
{{ $color := "primary" }}{{ $status := .Site.Params.version.status }}{{ $latest_version := .Site.Params.version.current_version_url }}{{ if eq $status "unstable"}}<div class="pageinfo pageinfo-{{ $color }} pageinfo-unstable"> <p>You're looking at an unstable version of this specification. Unstable specifications may change at any time without notice.</p> <p><a href="{{ $latest_version | safeURL }}">Switch to the current stable release</a>.</p></div>{{ else if eq $status "historical" }}<div class="pageinfo pageinfo-{{ $color }}"> <p>You're looking at an old version of this specification.<p> <p><a href="{{ $latest_version | safeURL }}">Switch to the current stable release</a>.</p></div>{{ end }}123456789{{- $ver := .Params.v -}}
{{- with page.Params.version -}} {{- if eq $ver . -}} <strong>[New in this version]</strong> {{- end -}}{{- else -}} <strong>[Added in <code>v{{ $ver }}</code>]</strong>{{- end -}}1{{ partial "alert" (dict "type" "note" "content" .Inner) }}1{{ partial "alert" (dict "type" "rationale" "content" .Inner) }}1{{ partial "alert" (dict "type" "warning" "content" .Inner) }}.gitattributes+1
docs/platforms.mdAdded+98
docs/release-checklist.mdAdded+97
docs/reproducible-builds.mdAdded+76
docs/security-updates.mdAdded+210
docs/spec-site.mdAdded+114
docs/threat-model.mdAdded+425
docs/user-guide.mdAdded+412
go.modAdded+5
go.sumAdded+4
informal/idp-brands.mdAdded+67
layouts/404.htmlAdded+8
layouts/_markup/render-heading.htmlAdded+11
layouts/_markup/render-passthrough.htmlAdded+11
layouts/_partials/added-in.htmlAdded+13
layouts/_partials/alert.htmlAdded+20
layouts/_partials/breadcrumb.htmlAdded+35
layouts/_partials/changed-in.htmlAdded+11
layouts/_partials/endpoints-toc.htmlAdded+61
layouts/_partials/events/example.htmlAdded+16
layouts/_partials/events/render-event.htmlAdded+108
layouts/_partials/favicons.htmlAdded+11
layouts/_partials/footer/center.htmlAdded+30
layouts/_partials/head-css.htmlAdded+38
layouts/_partials/hooks/body-end.htmlAdded+17
layouts/_partials/hooks/head-end.htmlAdded+18
layouts/_partials/json-schema/resolve-additional-types.htmlAdded+251
layouts/_partials/json-schema/resolve-allof.htmlAdded+89
layouts/_partials/json-schema/resolve-examples.htmlAdded+71
layouts/_partials/json-schema/resolve-refs.htmlAdded+87
layouts/_partials/navbar-version-selector.htmlAdded+18
layouts/_partials/navbar.htmlAdded+102
layouts/_partials/openapi/render-api.htmlAdded+59
layouts/_partials/openapi/render-content-type.htmlAdded+37
layouts/_partials/openapi/render-media-type-objects.htmlAdded+104
layouts/_partials/openapi/render-object-table.htmlAdded+342
layouts/_partials/openapi/render-operation.htmlAdded+120
layouts/_partials/openapi/render-parameters.htmlAdded+35
layouts/_partials/openapi/render-request.htmlAdded+42
layouts/_partials/openapi/render-responses.htmlAdded+64
layouts/_partials/render-example.htmlAdded+40
layouts/_partials/search-input.htmlAdded+10
layouts/_partials/sidebar-tree.htmlAdded+194
layouts/_partials/spec-content.htmlAdded+14
layouts/_partials/toc.htmlAdded+29
layouts/_partials/version-banner.htmlAdded+22
layouts/_shortcodes/added-in.htmlAdded+9
layouts/_shortcodes/boxes/note.htmlAdded+1
layouts/_shortcodes/boxes/rationale.htmlAdded+1
layouts/_shortcodes/boxes/warning.htmlAdded+1