refactor: remove redundant input-validation helpers
Remove the remaining ad hoc validation helpers after the schema-level pagination and text-handling changes in #558 and #556.
Both PC preset creation endpoints already validate names and hardware IDs with Zod and take ownership from the authenticated session. Bulk game moderation validates nonempty UUID arrays at its API boundary; direct empty service calls still fail before any write or trust adjustment. The unused security-validation module can now be deleted.
Part of #442. The existing global CSP, sanitized Markdown rendering and context-specific text escaping were checked at their owning sources.
Validation: 189 focused API/schema/UI tests pass, including 18 guard/ownership regressions across real preset routers and direct/boundary game moderation. Normal push hooks passed lint, types and all 2,951 unit tests with no skips. Repository-wide TypeScript import search found no remaining references to the deleted module.
Summary by cubic
Removes the ad hoc validation helpers in security-validation.ts now that Zod schemas already validate names, hardware IDs, and UUID arrays at the API boundary. Adds regression tests locking in boundary-level validation and session-owned preset creation.
Testing
- Empty bulk game moderation requests fail with
BAD_REQUESTbefore any trust score or data change, both through the router and direct service calls. - Both web and mobile PC preset creation reject invalid names, hardware IDs, and duplicate names before touching the repository, and take ownership from the authenticated session.
- Follows up on the TODO for #442; the global CSP, sanitized Markdown, and text escaping were verified at their owning sources.
Summary by CodeRabbit
-
Bug Fixes
- Empty bulk game approval and rejection requests return an error without changing game or related records.
- Invalid PC preset requests are rejected for malformed details, duplicate names, missing hardware, or ownership mismatches.
-
Tests
- Added coverage for bulk game moderation and PC preset validation across web and mobile.