Skip to content

M5b: calendar sharing and public links - #38

Merged
jan-runkel-zeitgleich merged 2 commits into
mainfrom
m5b-sharing
Oct 23, 2026
Merged

jan-runkel-zeitgleich merged 2 commits into
mainfrom
m5b-sharing

Conversation

@jan-runkel-zeitgleich

Copy link
Copy Markdown
Contributor

M5b: sharing calendars and address books between users, and public read-only links. Design: docs/sharing.md.

  • Sharing ([sharing] enabled = true by default): owner shares a collection with a local user, read or read-write; the sharee must accept (web UI, REST, Apple CS:invite-reply), can decline or leave. Accepted shares appear in the sharee's home as /dav/calendars/<sharee>/<owner>-<slug>/; the owner's path never resolves for anyone else. Owner only: delete/rename, description, time zone, dead properties, shares, links. Sharees: own display name/colour/order per share. Read-write: PUT/DELETE (owner's trash and quota), MOVE/COPY within the share; never between different owners. Every sharee write re-checks the share and refuses scheduling objects (Schedule-Tag) inside the write transaction; revoked = byte-identical to nonexistent everywhere (incl. sync-collection, attachments).
  • Private events: for read-only sharees CLASS ≠ PUBLIC (overrides inherit) is served as a whitelisted busy stub with its own ETag, consistent across GET/PROPFIND/multiget/query/sync; text filters can't probe hidden text; attachments of private objects unreadable.
  • Apple CalendarServer sharing: calendarserver-sharing, CS:share POST (atomic), CS:invite, CS:shared-owner, CS:allowed-sharing-modes, notification collection, CS:invite-reply. Limits: 100 shares/collection, 100 pending per sharee, 5 pending per owner→sharee, 24 h re-invite block after decline.
  • Scheduling: sharee writes never schedule (no invitations in the owner's name); free/busy and default calendar use own calendars only; inbox/outbox never shared. Attachments: sharees read while shared; read-write sharees add/remove (owned by and charged to the owner).
  • Public links ([publish], off by default, needs base_url): <base_url>/public/<token>.ics + webcal://; 256-bit token stored as BLAKE3 hash, constant-time compare, shown once, revocable; uniform 404 (also malformed paths and feature off); only misses count towards the rate limit. VEVENTs only, property whitelist, no alarms/ATTACH/RELATED-TO/URL/X-*, UIDs hashed per link, ORGANIZER/ATTENDEE only on opt-in, busy-only mode, private events busy/hidden/shown per link, left-out overrides become EXDATEs. Token never logged.
  • REST API + web UI (share management, "shared with me", links), openapi.json, migration 0013_sharing.
  • Tests: tests/sharing.rs, tests/publish.rs, store/parser tests, authz matrix (read share, rw share, pending, revoked, notifications, new routes), log_secrets, dav_xml fuzz seeds, config, python-caldav sharing session in the compat job.
  • Docs: docs/sharing.md, README, example config, PLAN, produktionsreife, angriffshistorie (70–77), SECURITY.md, CHANGELOG.

Reviewed by a Sonnet agent; fixed: sharee MOVE/COPY over the owner's meetings, publish feature detectable via malformed paths, invitation spam, publish blacklist leaks (RELATED-TO, URL, CONFERENCE, X-*), private overrides, rate limit hitting valid links, Schedule-Tag race, non-atomic CS:share.

Not included: group shares, CLI, CS:shared-url, reply notifications to the owner, IETF DAV:share-resource; restoring a collection from the trash doesn't restore its shares. Not tried with Apple Calendar or other real clients; web UI not seen in a browser.

🤖 Generated with Claude Code

jan-runkel-zeitgleich and others added 2 commits October 23, 2026 15:25
Sharing between users ([sharing] enabled = true by default):
- Owner shares a collection read or read-write; pending until the sharee
  accepts (REST, web UI, Apple CS:invite-reply). Accepted shares live in
  the sharee's own home (/dav/calendars/<sharee>/<owner>-<slug>/); the
  owner's paths never resolve for anybody else.
- Owner keeps collection settings, sharing and deletion; sharee may set
  their own name/colour/order, DELETE of the collection unsubscribes.
- Sharee writes count against the owner's quota, deletions go to the
  owner's trash, every write re-checks the share in its transaction,
  never scheduled; owner's scheduling objects are read-only for sharees.
- No MOVE/COPY between owners. Attachments readable by sharees while
  shared, uploads by sharees owned by the owner.
- Apple CalendarServer sharing: CS:share POST, CS:invite,
  CS:allowed-sharing-modes, notification collection, CS:invite-reply.
- REST: /v1/collections/{kind}/{slug}/shares, /v1/shared,
  /v1/admin/shares; web UI share panel and "Shared with me".

Public links ([publish], off by default, needs base_url):
- /public/<token>.ics, 256-bit token stored hashed, uniform 404,
  per-client miss limit, ETag/304, sandbox CSP, Cache-Control private.
- Busy-only option, private events busy/hidden/shown, never ATTACH,
  VALARM, original UIDs; ORGANIZER/ATTENDEE only on request.

Migration 0013_sharing. Tests: tests/sharing.rs, tests/publish.rs,
authorization matrix (shared read/rw, pending, revoked, new routes),
log_secrets, store tests, fuzz target dav_xml, python-caldav job.
Docs: docs/sharing.md, README, PLAN, produktionsreife, angriffshistorie.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Read-only sharees see events with CLASS other than PUBLIC (overrides
  inherit the master's) as whitelisted busy stubs with an ETag of the
  stub, in GET, PROPFIND, multiget, query and sync; attachments of
  private objects are not readable through read-only shares
  (items.private, computed by a trigger).
- Sharees cannot MOVE/COPY over, or move away, scheduling objects; all
  sharee writes check for a Schedule-Tag inside the transaction.
- Public links: raw path parsing (no 400 for malformed escapes, counted
  as misses), valid links served before the miss limit, property
  whitelist, inherited CLASS, left-out overrides become EXDATEs.
- Invitation limits: 5 pending per owner and sharee, 24 h block after a
  decline or leave; CS:share requests are all or nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jan-runkel-zeitgleich
jan-runkel-zeitgleich merged commit 5e25eab into main Oct 23, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant