-
Notifications
You must be signed in to change notification settings - Fork 5
Allow image assets download from email #1211
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
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.
Pull Request Overview
This PR adds secure image asset download functionality from emails by implementing a hash-based authorization mechanism. It allows public access to assets with a valid hash parameter while maintaining security through hash verification.
- Implements a new AssetVoter for hash-based authorization
- Adds public access to asset routes with proper security controls
- Updates asset URLs to include secure hash parameters
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Security/Voter/AssetVoter.php | New voter implementing hash-based authorization for asset access |
| src/Entity/Asset/Asset.php | Adds getHash() method to generate SHA-256 hash of asset data |
| src/Controller/App/Asset/GetAssetController.php | Updates authorization to allow public access with valid hash |
| src/Controller/App/Asset/AddAssetController.php | Includes hash parameter in generated asset URLs |
| config/packages/security.php | Configures public access for asset routes |
| tests/Unit/Security/Voter/AssetVoterTest.php | Comprehensive test coverage for AssetVoter functionality |
| tests/Unit/Entity/Asset/AssetTest.php | Tests hash generation method |
| tests/Unit/Controller/App/Asset/AddAssetControllerTest.php | Updates test to include hash in URL generation |
| AGENTS.md | Corrects filename in markdown header |
| .github/copilot-instructions.md | Adds comprehensive project documentation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1211 +/- ##
=========================================
Coverage 99.98% 99.98%
- Complexity 3350 3357 +7
=========================================
Files 582 583 +1
Lines 9935 9945 +10
=========================================
+ Hits 9934 9944 +10
Misses 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <[email protected]>
Give access to image assets for images send via email