-
Notifications
You must be signed in to change notification settings - Fork 0
feat: validate event_type filter against known enum in activity endpoint #838
Copy link
Copy link
Closed
Labels
prio:lowNice to have, can deferNice to have, can deferscope:smallLess than 1 day of workLess than 1 day of workspec:apitype:featureNew feature implementationNew feature implementationv0.5Minor version v0.5Minor version v0.5v0.5.3Patch release v0.5.3Patch release v0.5.3
Description
Context
The GET /api/v1/activities endpoint accepts an event_type query parameter as a free-form string (max 64 chars). Invalid values silently return empty results.
Proposed Solution
Define a StrEnum or Literal type for the 12 known event types (hired, fired, promoted, demoted, onboarded, offboarded, status_changed, task_completed, task_started, cost_incurred, tool_used, delegation_sent, delegation_received) and use it as the parameter type. This makes the OpenAPI schema self-documenting and rejects invalid values with a 400.
Files
src/synthorg/api/controllers/activities.py(parameter type)
Source
Found during PR #832 review (security-reviewer agent).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
prio:lowNice to have, can deferNice to have, can deferscope:smallLess than 1 day of workLess than 1 day of workspec:apitype:featureNew feature implementationNew feature implementationv0.5Minor version v0.5Minor version v0.5v0.5.3Patch release v0.5.3Patch release v0.5.3