Download the PHP package spiral-packages/signed-urls without Composer
On this page you can find all versions of the php package spiral-packages/signed-urls. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download spiral-packages/signed-urls
More information about spiral-packages/signed-urls
Files in spiral-packages/signed-urls
Package signed-urls
Short Description Create and validate signed URLs in Spiral Framework
License MIT
Homepage https://github.com/spiral-packages/signed-urls
Informations about the package signed-urls
Signed URL generator for Spiral Framework based on Laravel
The package allows you to easily create "signed" URLs to named routes. These URLs have a "signature" hash appended to the query string which allows Spiral Framework to verify that the URL has not been modified since it was created.
Signed URLs are especially useful for routes that are publicly accessible yet need a layer of protection against URL manipulation.
Requirements
Make sure that your server is configured with following PHP version and extensions:
- PHP 8.1+
- Spiral framework 3.0+
Installation
You can install the package via composer:
After package install you need to register bootloader from the package.
Note if you are using
spiral-packages/discoverer
, you don't need to register bootloader by yourself.
Specify env variables
Usage
For example, you might use signed URLs to implement a public "email verification" link that is emailed to your customers:
If you would like to generate a temporary signed route URL that expires after a specified amount of time, you may pass expiration date in method. When Spiral Framework validates a temporary signed route URL, it will ensure that the expiration timestamp that is encoded into the signed URL has not expired:
You may sign not only routes but also Urls:
Validating Signed Urls
To verify that a URL has a valid signature, you should call the hasValidSignature method:
Instead of validating signed URLs using the incoming request instance, you may assign the
Spiral\SignedUrls\Middleware\ValidateSignature
middleware to the route:
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Pavel Buchnev
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of signed-urls with dependencies
spiral/boot Version ^3.0
spiral/router Version ^3.0
spiral/http Version ^3.0
psr/http-message Version ^1.0