Download the PHP package snicco/signed-url-psr15-bridge without Composer
On this page you can find all versions of the php package snicco/signed-url-psr15-bridge. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download snicco/signed-url-psr15-bridge
More information about snicco/signed-url-psr15-bridge
Files in snicco/signed-url-psr15-bridge
Package signed-url-psr15-bridge
Short Description Psr15 middleware integration for snicco/signed-url.
License LGPL-3.0-only
Informations about the package signed-url-psr15-bridge
A PSR-15 middleware for the snicco/signed-url library
This package consists of two simple middlewares that will make working with snicco/signed-url
a breeze. Make sure to
read the general documentation to
know how to instantiate the needed collaborators.
Installation
Usage
Make sure that your favorite framework supports binding middleware on the route level. This middleware should only be added to a route where you expect signed urls, not globally.
Basic Usage
Customizing the additional request context.
As a second argument you can pass a closure that will receive the current request. Anything you return from this closure will be taken into account when validating the current request.
This has to match the request context that you used when the link was created!
Using the ip-address at creation and the user-agent at validation will not work and the request will always be
invalidated.
Only validate unsafe HTTP methods
If a signed-url should be used exactly one time (for GET
requests) you might run into trouble with certain email clients that preload all
links. In this case you can set the third argument of the middleware to (bool) true
. The signature will then only be checked
if the request method is one of [POST, PATCH, PUT, DELETE]
.
Make sure you route is not accessible with safe request methods if you use this option.
Garbage collection
Add the CollectGarbage
middleware to your global middleware groups.
All versions of signed-url-psr15-bridge with dependencies
psr/log Version ^1.1.1
psr/http-message Version ^1.0.0
psr/http-server-middleware Version ^1.0.0
psr/http-server-handler Version ^1.0.0
snicco/signed-url Version ^2.0