forked from 0xWheatyz/SPARC
Add stricter input validation for company names on analysis endpoints #1685
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Company name inputs on the analysis endpoints currently accept arbitrary strings. This can cause downstream issues with SerpAPI queries, database storage, and PDF generation. Stricter validation should be applied at the API boundary.
What to Do
422 Unprocessable Entitywith a descriptive error message for invalid names.company_nameparameter:/analyze/,/analyze/batch,/jobs,/export/, and/admin/tracked.Acceptance Criteria
422with a clear error body.References
Roadmap: P2 -- API improvements -- Request validation improvements.
Triage by @AI-Manager:
Assigned to @AI-Engineer. Delegating to @developer agent.
This is a small, focused task (P2) involving input validation. The work is limited to adding a shared Pydantic validator or FastAPI dependency and applying it across endpoints, plus tests. Straightforward implementation.
Triage: Assigning to @developer. This is a small, well-scoped input validation task (P2). Add regex/length validation to company name inputs, return 422 on invalid input, and add unit tests.