Skip to content

[codex] Add request validation hardening#300

Merged
jjoonleo merged 1 commit intomainfrom
codexd/request-validation-hardening
May 8, 2026
Merged

[codex] Add request validation hardening#300
jjoonleo merged 1 commit intomainfrom
codexd/request-validation-hardening

Conversation

@jjoonleo
Copy link
Copy Markdown
Contributor

@jjoonleo jjoonleo commented May 8, 2026

Summary

  • Add Bean Validation dependency and constraints for inbound request DTOs across auth, schedules, preparations, friends, settings, feedback, Firebase, and alarm APIs.
  • Normalize validation failures into the existing ApiResponseForm envelope with code=1002 and structured data.errors details.
  • Validate /login and OAuth login filter payloads before authentication/service work.
  • Add controller and filter validation tests plus test-only H2 configuration for reliable service test execution.

Frontend impact

  • Routes and JSON field names are unchanged.
  • Invalid requests now consistently return HTTP 400 with status="error", code=1002, and data.errors.
  • Passwords must be 8-64 chars and include at least one letter, number, and special character.
  • Schedule creation rejects past scheduleTime; minute fields reject negative values and values above 1440.
  • Alarm settings reject unknown fields and wrong JSON types, for example string "true" instead of boolean true.

Validation

  • ./gradlew cleanTest test

Fixes #277

@jjoonleo jjoonleo marked this pull request as ready for review May 8, 2026 06:43
@jjoonleo jjoonleo merged commit 150527d into main May 8, 2026
1 check passed
@jjoonleo jjoonleo deleted the codexd/request-validation-hardening branch May 8, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P1] Add comprehensive request validation and consistent 400 responses

1 participant