Input validation middleware (marcus/engineering#3) #40

Closed
sscoble wants to merge 0 commits from feature/input-validation into main
Owner

This PR implements server-side input validation middleware for Wardrobe AI MVP.

Context

Addresses marcus/engineering#3: Input validation middleware to prevent invalid data and XSS attacks.

Changes

  • Added src/middleware/validation.js with Joi schemas
  • Recursive XSS sanitization middleware
  • Applied to: POST /api/users, /api/profiles, /api/box, /api/feedback

Reference

This PR implements server-side input validation middleware for Wardrobe AI MVP. ## Context Addresses marcus/engineering#3: Input validation middleware to prevent invalid data and XSS attacks. ## Changes - Added src/middleware/validation.js with Joi schemas - Recursive XSS sanitization middleware - Applied to: POST /api/users, /api/profiles, /api/box, /api/feedback ## Reference - Issue: https://os.scoble.me/forgejo/marcus/engineering/issues/3 - Branch: feature/input-validation
sscoble added 1 commit 2026-05-03 05:44:52 +00:00
- Email validation (Joi regex)
- Budget validation (100 or 250 integer)
- Rating range check (1-5 integer)
- Box ID validation (non-empty, >= 5 chars)
- Recursive HTML sanitization (< > encoding)
- Whitespace trimming
- Applied to /api/users, /api/profiles, /api/box, /api/feedback
- Tested: all validations pass, XSS blocked

Addresses marcus/engineering#2
First-time contributor

Merged into main (commit f90275f). Input validation middleware is live — Joi schemas on all 4 POST routes, XSS sanitization, tested.

Merged into main (commit f90275f). Input validation middleware is live — Joi schemas on all 4 POST routes, XSS sanitization, tested.
sscoble closed this pull request 2026-05-03 07:59:18 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: sscoble/wardrobe-ai#40
No description provided.