Mediathek docs

Decisions

ADR-0010 — Households and vaults

Status: Accepted · Date: 2026-10-01 · Supersedes the single-family access model of ADR-0002 (mt-family) and ADR-0005 (one CDN policy for everything)

Amended by ADR-0011. "Move to vault" exists now (moveToVault, /edge/v1/media/move), with its knowledge and album entries, and the old derived files deleted at once. An item lives in one vault: the most private one wins when the same photo is meant for two.

Context

Until now one Mediathek was one family. mt-family could read everything and mt-admins could do everything. The signed CDN policy covered every file under derived/, and the catalog was keyed by a photo's SHA-256 alone.

That leaves two gaps:

Decision

Household. A household (h-…, minted) is a group of people with their own admins.

Vault. A vault (v-…, minted) is a set of photos and videos with its own readers.

Who sees what (enforced by AppSync and the Lambdas, not by the page):

Who Sees
vault reader (group v-…) that vault's photos, albums and A-Box
household admin (group h-…) every vault of the household. Can also write: A-Box, angles, tags, members, new vaults, edge pairing
operator (mt-admins) runs the platform: creates households, sees household names and edge metadata. No photos, names or A-Boxes unless also a member

Catalog. New models carry vaultId and householdId. Their rules are groupDefinedIn("vaultId") (read) and groupDefinedIn("householdId") (read and update), so a row is visible exactly to the groups it names. The models:

The old Item, Collection and Membership models are removed once the re-published library has been checked.

Files. mediaPolicy signs one CloudFront custom policy per vault the caller may read, each for https://<cdn>/<vault>/*.

Membership. A households function creates households and vaults, which means Cognito groups. It adds and removes members by e-mail (AdminAddUserToGroup), only for accounts that already exist, since signup stays admin-only (ADR-0002).

Edges belong to a household. Pairing (approveDeviceCode) names the household and needs one of its admins. The registry row keeps it, and every edge call is limited to that household's vaults. An edge paired before this has no household and is refused until it is linked again. /edge/v1/household tells an edge its household and vaults.

A-Boxes per vault. A private vault's people, events and links stay in that vault's graph.

Migration.

  1. An operator creates the first household.
  2. The edge is linked again (now to that household).
  3. The edge re-publishes into the family vault: about 2.2 GB, about €0.20 of download from the old buckets.
  4. Face boxes, angles and the A-Box (main → the family vault's graph) follow on Sync.
  5. Once checked, the old models, files and mt-family are removed.

Consequences

Addendum (2026-10-01): the same household on two sites

Store keys carry the household id (originals) and the vault id (derived files). Because each environment minted its own ids, prod would have uploaded every original again and converted every film again, which defeats ADR-0007's single store.