Commit graph

11 commits

Author SHA1 Message Date
Claude
64ef80a21c
style: fix linting issues
- Fix SQLite GetReaction to use standard List pattern (consistent with MySQL/PostgreSQL)
- Add periods to comment endings (godot linter requirement)
- Simplify GetReaction implementation to avoid sql.ErrNoRows handling
2025-11-06 12:14:30 +00:00
Claude
1a3298554b
fix(security): implement security review recommendations
This commit addresses all critical and high-priority recommendations from the security review:

**Critical Fixes:**
- Add nil checks before accessing memo properties in SetMemoAttachments and SetMemoRelations
  to prevent potential nil pointer dereference
- Fix information disclosure in DeleteMemoReaction by returning consistent errors
  (now returns permission denied instead of not found to avoid revealing reaction existence)

**Medium Priority Improvements:**
- Add GetReaction() method to store interface for better performance
  (single reaction lookup instead of list operation)
- Implement GetReaction() in all database drivers (SQLite, MySQL, PostgreSQL)
- Update DeleteMemoReaction to use the new GetReaction() method

**Test Coverage:**
- Add comprehensive test coverage for SetMemoAttachments authorization checks
- Add comprehensive test coverage for SetMemoRelations authorization checks
- Add comprehensive test coverage for DeleteMemoReaction authorization checks
- Add comprehensive test coverage for CreateUser registration enforcement

All tests follow the same patterns as existing IDP service tests and cover:
- Success cases for resource owners
- Success cases for superuser/host users
- Permission denied cases for non-owners
- Unauthenticated access attempts
- Not found scenarios

Related to PR #5217 security review recommendations.
2025-11-06 12:07:38 +00:00
Florian Dewald
769dcd0cf9
fix(security): add missing authorization checks to various services (#5217) 2025-11-06 19:42:44 +08:00
Johnny
efe6013c36 fix: add user authentication checks 2025-10-08 20:30:05 +08:00
varsnotwars
a9508b2546
chore: simplify convert reaction (#5001) 2025-08-14 00:06:23 +08:00
Steven
83febf9928 chore: clean resource definition 2025-06-23 21:08:25 +08:00
Steven
9972a77d9e refactor: memo service 2025-06-18 19:58:38 +08:00
johnnyjoy
f1308ddd27 refactor: update part of resource identifier 2025-01-19 23:03:22 +08:00
Steven
e527b6a878 feat: move reaction type to setting 2024-10-10 21:06:32 +08:00
Steven
1ccfa81cf3 chore: tweak common function 2024-05-26 11:02:23 +08:00
Steven
20dd3e17f7 chore: rename router package 2024-05-01 10:28:32 +08:00
Renamed from server/route/api/v1/reaction_service.go (Browse further)