lisa/fix-screenshots-only-as-image-types#394
Open
gusfcarvalho wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
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
validateEvidenceSubmissionFileTypeand a smallfileExtensionhelper invoked fromvalidateEvidenceRequirementsto enforce image-only types for screenshot evidence. - Introduce
ErrInvalidEvidenceSubmissionsentinel error, surfaced as a 400 response inStepExecutionHandler.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.
Contributor
Author
|
lisa: implementation done. no actionable copilot review threads found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
automated implementation by lisa.