feat/account-data-export #83

Merged
nrupard merged 2 commits from feat/account-data-export into main 2026-05-13 17:45:41 +02:00
Owner
No description provided.
Adds GET /settings/export-data and a Download my data button on the
settings page. The handler aggregates the signed-in user's rows from
auth.db and chat.db into a single JSON file: profile, notification
preferences, sessions, push subscriptions, blocks (both directions),
invite codes, enclave + room memberships and notification overrides,
messages, reactions, bookmarks, pins, mentions received, file-upload
metadata, custom emoji uploads, DM read state, and moderation actions
taken against the user. Each file_uploads row carries the existing
/api/files/{id} URL so the same authenticated user can pull the bytes;
avatar bytes are likewise reachable via /avatars/{user_id}.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
fix(account-export): hash session ids instead of exporting raw tokens
Some checks failed
Check / clippy + fmt + tests (pull_request) Failing after 25s
14db5685bf
The raw session.id in auth.db is the bearer credential carried in the
session cookie. Including it in the portable JSON dump meant a leaked
export was equivalent to handing over a live login until the row
expired. Replace the `id` field on each session row with `id_sha256`,
the SHA-256 of the raw token, so each row stays uniquely identifiable
for the user without exposing anything reusable as a credential.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
nrupard deleted branch feat/account-data-export 2026-05-13 17:45:41 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/lets-chat!83
No description provided.