Commit 76061b7
committed
feat: add public notes API for publishing encrypted notes
- Add public_notes table with slug-based access
- Implement CRUD endpoints for publishing/unpublishing notes
- Add XSS protection with DOMPurify (blocks script, iframe, javascript: URLs)
- Hide sensitive fields (id, noteId, userId) from public GET response
- Add publish status fields to notes API responses
- Generate cryptographically secure slugs with nanoid
Security: Server-side HTML sanitization, ownership checks on all authenticated endpoints, no enumeration possible1 parent 9835f6f commit 76061b7
File tree
10 files changed
+1845
-8
lines changed- drizzle
- meta
- src
- db
- lib
- routes
- notes
- public-notes
10 files changed
+1845
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
0 commit comments