| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…L validation
Add a route decorator attribute that automatically validates signed URLs,
eliminating the need for manual validation in each controller method.
Features:
- New #[ValidSignature] attribute to enforce signature validation on routes
- Returns 403 Forbidden when signature is missing, invalid, or expired
- Works with both permanent and temporary signed URLs
Usage:
#[Get('/verify-email/{token}')]
#[ValidSignature]
public function verifyEmail(string $token): Response
{
// This code only executes if the signature is valid
}
Files added:
- packages/router/src/ValidSignature.php - Route decorator attribute
- packages/router/src/ValidSignatureMiddleware.php - Validation middleware
- tests/Integration/Route/ValidSignatureMiddlewareTest.php - 8 integration tests
- tests/Integration/Route/Fixtures/SignedUrlController.php - Test fixture
…ery] for route-specific application
|
Closing this PR for the reasons explained in the other ones |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This PR adds a route decorator attribute that automatically validates signed URLs, eliminating the need for manual validation in each controller method.
Motivation
Currently, when using signed URLs, developers must manually validate the signature in every controller method:
This is repetitive, error-prone, and clutters controller code with validation logic.
Solution
The new #[ValidSignature] attribute handles validation automatically:
Features
Usage Examples
Permanent signed URL
Temporary signed URL