amber-backend/pb_hooks
Claude e781557694 Add /settings web editor for the encrypted addon config
A login → decrypt → edit → re-encrypt page so account settings (the
addon URLs + TMDB key) can be changed from any browser instead of typing
them on a TV. Doubles as the per-user config-update tool (editing a live
account's config, which the one-time onboarding template can't do).

- pb_public/settings.html: auth-with-password, load the owner's
  addon_config (rules already scope to profile.user), decrypt the blob
  in-browser with the password (PBKDF2→AES-GCM, byte-identical to the app
  + onboarding page), edit fields, re-encrypt and PATCH.
- Crucial: re-encrypt reusing the record's EXISTING salt, so the derived
  key is unchanged and an already-logged-in device (which cached that key
  and has no password on a restored session) decrypts the edited blob
  with no re-entry. A fresh salt would force a TV re-entry — the opposite
  of the point.
- 18+ fields (adult addon URL + enable toggle) render only for an account
  with nsfwEnabled; a clean account never sees them and their stored
  values are carried through untouched on save.
- pb_hooks/settings.pb.js: /settings → /settings.html redirect.

No server logic beyond the redirect — all crypto/IO is client-side against
the existing collection API. Crypto round-trip + salt-reuse + wrong-key
rejection verified against the app's format (WebCrypto, Node).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 18:20:24 +02:00
..
client_logs.pb.js Add client_logs collection for background device diagnostics (feedback 2 §4) 2026-07-23 11:49:04 +02:00
device_auth.pb.js fix(device-auth): inline helpers into each hook handler (JSVM scope) 2026-07-19 19:48:03 +02:00
device_page.pb.js device approve page: manual code-entry for the QR-less path (#55) 2026-07-20 11:06:51 +02:00
onboarding.pb.js Family onboarding site: invite-gated signup, template config, /get/tv 2026-07-22 18:23:05 +02:00
profile_pin.pb.js Add /api/amber/set-pin: hidden pinHash rejects client writes (#13/#14) 2026-07-21 21:29:02 +02:00
settings.pb.js Add /settings web editor for the encrypted addon config 2026-07-23 18:20:24 +02:00
update.pb.js Auto-update backend: releases collection + gated manifest (#16) 2026-07-20 11:36:03 +02:00