feat(api): add endpoint for AI conversation details#106071
feat(api): add endpoint for AI conversation details#106071constantinius merged 5 commits intomasterfrom
Conversation
- Introduced a new URL pattern for accessing details of specific AI conversations. - Added a corresponding constant in the Referrer class for the new endpoint. - Refactored tests to extend from a base test case for better organization and maintainability.
|
🚨 Warning: This pull request contains Frontend and Backend changes! It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently. Have questions? Please ask in the |
| name="sentry-api-0-organization-ai-conversations", | ||
| ), | ||
| re_path( | ||
| r"^(?P<organization_id_or_slug>[^/]+)/ai-conversations/(?P<conversation_id>(?:\d+|[A-Za-z0-9-_]+))/$", |
There was a problem hiding this comment.
URL regex allows unintended characters due to hyphen placement
Medium Severity
The regex pattern [A-Za-z0-9-_] has the hyphen positioned between 9 and _, which creates an unintended character range from - (ASCII 45) to _ (ASCII 95). This matches many more characters than intended, including :, ;, <, >, ?, @, [, \, ], and ^. Elsewhere in the codebase (e.g., cursor/webhooks/handler.py), the correct pattern [a-zA-Z0-9_-] is used with the hyphen at the end. The unintended characters like : could affect query parsing when the conversation_id is interpolated into the query string in _fetch_conversation_spans.
Closes https://linear.app/getsentry/issue/TET-1703/conversation-details-endpoint