US-EPA-CAMD / easey-ui

Project Management repo for EPA Clean Air Markets Division (CAMD) Business Suite of applications
MIT License
0 stars 0 forks source link

Input Validation for CAMPD v1.5 API - `easey-mdm-api` #6419

Open spetros-do opened 1 month ago

spetros-do commented 1 month ago

Body:


 Overview
The easey-mdm-api is responsible for managing metadata and must have robust input validation in place. 
This ticket focuses on adding proper input validation across all endpoints to prevent invalid metadata submissions 
and mitigate potential security risks.

 Key Tasks
- Implement input validation for metadata creation and updates, including ensuring that all required fields are properly sanitized and validated.
- Use decorators to enforce input type checks (e.g., strings, numbers, enums).
- Add input sanitization to prevent SQL injection or improper metadata handling.
- Ensure that all metadata entries are validated for correctness and completeness.
- Write unit tests to confirm validation logic.

 Acceptance Criteria
- All metadata inputs should be validated for correctness and type before processing.
- Invalid inputs should return appropriate error responses (e.g., `400 Bad Request`).
- SQL injection must be prevented via input sanitization and parameterized queries.
- Unit tests must confirm that validation and sanitization logic is working as expected.
lgiannini1 commented 5 hours ago