pediatric-ai-scribe-v3/src/routes
Daniel 7c45367c02 Security hardening: PHI encryption, argon2, DOMPurify, SRI
- App-layer AES-256-GCM crypto helper (src/utils/crypto.js)
- Nextcloud tokens encrypted at rest; transparent migration on next use
- Audio backups encrypted at rest (version byte 0x01 envelope); legacy
  rows still decrypt as-is until overwritten
- argon2id password hashing via src/utils/passwords.js with bcrypt
  fallback; bcrypt hashes rehashed to argon2id on next successful login.
  argon2 package is optional — server keeps running with bcrypt only
  until npm install adds the native dep
- PHI redactor for audit log details (src/utils/redact.js) — strips SSN,
  phone, email, DoB, long IDs; caps at 500 chars; detects note bodies
- DOMPurify (cdnjs, SRI-pinned) replaces custom regex sanitizer in
  Learning Hub content rendering
- SRI integrity hashes added for Font Awesome CSS and Chart.js
- Magic-byte file-type verification on document uploads
  (src/utils/fileType.js)
- Generic 500 error responses via src/utils/errors.js applied to
  nextcloud and audioBackups; full detail still logged server-side
- DATA_ENCRYPTION_KEY env documented in .env.example

Deploy: requires rebuild of the container image to pick up the new
files and `npm install` (adds argon2). Existing users keep working
because bcrypt stays available and crypto helpers pass through
plaintext when the key is not yet set in dev.
2026-04-14 02:49:38 +02:00
..
admin.js Fix quiz SQL bug, security hardening, componentize HTML, speed improvements 2026-03-23 20:01:54 -04:00
adminConfig.js v6.1: Turnstile bot protection, LiteLLM provider, PPTX tables, audio backup fixes, docs 2026-04-04 22:56:24 +02:00
adminMilestones.js v2.1: Add visible bulk import UI for developmental milestones 2026-04-01 18:06:42 +00:00
audioBackups.js Security hardening: PHI encryption, argon2, DOMPurify, SRI 2026-04-14 02:49:38 +02:00
auth.js Security hardening: PHI encryption, argon2, DOMPurify, SRI 2026-04-14 02:49:38 +02:00
billing.js Security hardening: low-risk easy wins 2026-04-14 02:42:32 +02:00
chartReview.js v6.2: Session management, password change, audit logging, refine context, UI fixes 2026-04-08 20:27:45 +02:00
documents.js Security hardening: PHI encryption, argon2, DOMPurify, SRI 2026-04-14 02:49:38 +02:00
encounters.js Enhance audit logging: user agent, session ID, PHI access tracking 2026-04-11 06:17:05 +02:00
hospitalCourse.js v6.2: Session management, password change, audit logging, refine context, UI fixes 2026-04-08 20:27:45 +02:00
hpi.js v6.2: Session management, password change, audit logging, refine context, UI fixes 2026-04-08 20:27:45 +02:00
learningAdmin.js Add Vertex AI embeddings + semantic search for Learning Hub 2026-03-31 14:36:49 +00:00
learningAI.js v6.1: Turnstile bot protection, LiteLLM provider, PPTX tables, audio backup fixes, docs 2026-04-04 22:56:24 +02:00
learningHub.js Add Vertex AI embeddings + semantic search for Learning Hub 2026-03-31 14:36:49 +00:00
logs.js Enhance audit logging: user agent, session ID, PHI access tracking 2026-04-11 06:17:05 +02:00
memories.js v6.1: Turnstile bot protection, LiteLLM provider, PPTX tables, audio backup fixes, docs 2026-04-04 22:56:24 +02:00
milestones.js v6.2: Session management, password change, audit logging, refine context, UI fixes 2026-04-08 20:27:45 +02:00
nextcloud.js Security hardening: PHI encryption, argon2, DOMPurify, SRI 2026-04-14 02:49:38 +02:00
oidc.js Security hardening: low-risk easy wins 2026-04-14 02:42:32 +02:00
refine.js v6.2: Session management, password change, audit logging, refine context, UI fixes 2026-04-08 20:27:45 +02:00
sessions.js Fix session revocation bug that could log out current device 2026-04-09 02:33:00 +02:00
sickVisit.js v6.2: Session management, password change, audit logging, refine context, UI fixes 2026-04-08 20:27:45 +02:00
soap.js v6.2: Session management, password change, audit logging, refine context, UI fixes 2026-04-08 20:27:45 +02:00
transcribe.js v6.2: Session management, password change, audit logging, refine context, UI fixes 2026-04-08 20:27:45 +02:00
tts.js v6.2: Session management, password change, audit logging, refine context, UI fixes 2026-04-08 20:27:45 +02:00
userPreferences.js Add per-user voice preferences (STT model + TTS voice selection) 2026-03-31 14:47:00 +00:00
wellVisit.js v6.2: Session management, password change, audit logging, refine context, UI fixes 2026-04-08 20:27:45 +02:00