Skip to content

Conversation

@frankdekker
Copy link
Member

@frankdekker frankdekker commented Sep 19, 2025

Give access to image assets for images send via email

Copilot AI review requested due to automatic review settings September 19, 2025 18:51
Copy link
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

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
Copy link

codecov bot commented Sep 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.98%. Comparing base (ceacf52) to head (51adf2c).
⚠️ Report is 1 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@frankdekker frankdekker merged commit e3766fc into master Sep 19, 2025
5 checks passed
@frankdekker frankdekker deleted the Allow-image-assets-download-from-email branch September 19, 2025 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants