-
Notifications
You must be signed in to change notification settings - Fork 248
feat: Case attachments #1243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: Case attachments #1243
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cubic found 7 issues across 26 files. Review them in cubic.dev
React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai
to give specific feedback.
4b53071
to
d13364c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cubic found 3 issues across 28 files. Review them in cubic.dev
React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai
to give specific feedback.
087abe2
to
b3f93a1
Compare
1. test_validate_pdf_content: Updated to use the correct exception types (FileContentMismatchError and FileSecurityError instead of ValueError) and adjusted test expectations to match the new PDF validation behavior. 2. test_upload_delete_reupload_cycle: Fixed SQLAlchemy greenlet error by re-fetching database records instead of refreshing them, and updated expectation to match service behavior (reuses same attachment record). 3. test_upload_delete_reupload_different_case: Updated expectation for upload count - the service doesn't re-upload files that exist (even if soft-deleted). 4. test_multiple_uploads_same_content_deduplication: Updated expectation to match service behavior - returns the same attachment when uploading duplicate content to the same case.
…tion - Switch from multipart/form-data to JSON with base64 encoding to bypass AWS WAF restrictions - Add comprehensive XSS protection for file downloads with Content-Disposition headers - Block SVG files entirely due to embedded JavaScript risks - Separate preview functionality from downloads with strict content type controls - Update all tests to support new base64 upload format and security features - Add @pytest.mark.anyio decorators to async tests in test_blob_storage.py 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…S protection" This reverts commit 2c8df6a.
- Add preview parameter to download endpoint for safe image viewing - Implement force_download and override_content_type in presigned URLs - Update file size limits to more conservative values (20MB/200MB/10 files) - Add SVG validation and blocking for security - Separate preview vs download functionality for XSS protection - Add comprehensive test coverage for new security features 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Rename TRACECAT__BLOB_STORAGE_BUCKET to TRACECAT__BLOB_STORAGE_BUCKET_ATTACHMENTS - Make bucket parameter required in all storage functions - Update all storage calls to explicitly pass bucket name - Remove default bucket fallback behavior - Set default presigned URL endpoint configuration - Update tests to match new bucket configuration This change improves storage organization by using separate buckets for different types of data. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Remove TRACECAT__BLOB_STORAGE_PRESIGNED_URL_ENDPOINT config - Remove TRACECAT__DISABLE_PRESIGNED_URL_IP_CHECKING config - Remove client_ip parameter from presigned URL generation - Simplify URL transformation to directly replace MinIO internal URL - Update tests to work with simplified storage logic The presigned URLs now always transform "http://minio:9000" to "{TRACECAT__PUBLIC_APP_URL}/s3" for proper routing through the proxy. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Remove client_ip parameter from get_attachment_download_url method - Update router to stop passing client_ip from request state - Fix integration tests that were failing due to the parameter mismatch 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
0aa82ed
to
476d72e
Compare
476d72e
to
b486dda
Compare
Summary by cubic
Added support for uploading, listing, downloading, and deleting file attachments on cases, using MinIO for secure blob storage.
QA:
Screenshots