Skip to content

lisa/fix-screenshots-only-as-image-types#394

Open
gusfcarvalho wants to merge 1 commit into
mainfrom
lisa/fix-screenshots-only-as-image-types
Open

lisa/fix-screenshots-only-as-image-types#394
gusfcarvalho wants to merge 1 commit into
mainfrom
lisa/fix-screenshots-only-as-image-types

Conversation

@gusfcarvalho
Copy link
Copy Markdown
Contributor

automated implementation by lisa.

Copilot AI review requested due to automatic review settings May 15, 2026 14:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Restricts evidence submissions of type "screenshot" to image file types by validating both the declared MIME MediaType and the file extension against an allow-list, returning a new ErrInvalidEvidenceSubmission error mapped to HTTP 400 by the handler.

Changes:

  • Add validateEvidenceSubmissionFileType and a small fileExtension helper invoked from validateEvidenceRequirements to enforce image-only types for screenshot evidence.
  • Introduce ErrInvalidEvidenceSubmission sentinel error, surfaced as a 400 response in StepExecutionHandler.TransitionStep.
  • Add table-driven tests covering allowed media types/extensions, rejected document types, and unaffected non-screenshot evidence.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
internal/workflow/step_transition.go Adds screenshot file-type validation logic and new sentinel error.
internal/workflow/step_transition_test.go Tests accept/reject paths for screenshot evidence and confirms broader types remain allowed for non-screenshot evidence.
internal/api/handler/workflows/step_execution.go Maps the new error to HTTP 400 in the transition endpoint.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gusfcarvalho
Copy link
Copy Markdown
Contributor Author

lisa: implementation done. no actionable copilot review threads found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants