linkeys-app / signed-url Goto Github PK
View Code? Open in Web Editor NEWEnhanced signed URLs for Laravel, including attaching data, click limits and expiry.
License: MIT License
Enhanced signed URLs for Laravel, including attaching data, click limits and expiry.
License: MIT License
Summary of the bug
if the URL stored in https it cannot be used and become 404. but if you stored in http, it working.
To Reproduce
store the URL in https:// and you will try to open the pages with the middleware you will get 404.
Suggestion of a fix
maybe can make it check both HTTP and HTTPS.
What will the feature achieve?
Free up the 'link' key in the request.
Why is this necessary?
The link model is made available through $request->get('link');
, but this may be needed by a user since it is a common word.
How should the feature work?
The link model should instead be bound to the class name, e.g. \Linkeys\UrlSigner\Models\Link::class
. This is much less likely to be needed by an individual
Will this affect any other features?
Anywhere 'link' is used should be replaced but no other feature will be affected.
Any other information?
The service provider has a lot going on in single methods. These should be extracted to class methods in sensible groups.
What will the feature achieve?
Allow a link to be created using ::sign instead of ::generate
Why is this necessary?
::sign is cleaner and easier to remember than generate
How should the feature work?
A sign method should be declared in the UrlSigner, acting as an alias for the generate method
Will this affect any other features?
No, since sign will just be an alias and not change generate in any way.
Any other information?
What will the feature achieve?
Allow for easier access to the Facade through use of an alias
Why is this necessary?
This will remove the need to import the facade.
How should the feature work
The package should automatically register an alias for the facade
** Will this affect any other features**
No, since the alias is just another way to use the facade and the facade can still be used.
What will the feature achieve?
e.g. Allow a user to [...]
Why is this necessary?
Why do you think this is a good idea? Who will it help?
How should the feature work?
Try and include as much information as you can about how you'd like the feature to be used.
Will this affect any other features?
e.g. This will replace the method [...]
Any other information?
Any chance to update the spatie/url dependency in order to support recent versions of PHP?
╰─ composer require linkeys/signed-url ─╯
Using version ^5.0 for linkeys/signed-url
Your requirements could not be resolved to an installable set of packages.
Problem 1
- spatie/url 1.3.0 requires php ^7.0 -> your php version (8.2.5) does not satisfy that requirement.
- spatie/url[1.3.1, ..., 1.3.3] require php ^7.2 -> your php version (8.2.5) does not satisfy that requirement.
- spatie/url[1.3.4, ..., 1.3.5] require psr/http-message ^1.0 -> found psr/http-message[1.0, 1.0.1, 1.1] but the package is fixed to 2.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- linkeys/signed-url v5.0.0 requires spatie/url ^1.3 -> satisfiable by spatie/url[1.3.0, ..., 1.3.5].
- Root composer.json requires linkeys/signed-url ^5.0 -> satisfiable by linkeys/signed-url[v5.0.0].
What will the feature achieve?
Allow reusing existing records in the links table where the request previously existed or some process to delete old link from the links table.
Summary of the bug
This namespace is invalid and class does not exist which causes PHP warnings
Line 51 in a120631
PHP Warning: Class 'Linkeys\UrlSigner\Link' not found in .\vendor\laravel\framework\src\Illuminate\Foundation\AliasLoader.php on line 80
To Reproduce
Run
UrlSigner::sign('https://www.example.com/invitation')->url;
in Laravel Tinker after installing package and watch PHP warning appear.
Expected behaviour
No PHP warning.
Actual behaviour
PHP warning thrown.
Suggestion of a fix
Fix alias definition or remove, it doesn't seem like it's needed.
Please add laravel 7 support
Currently, the middleware must be run in the order
\Linkeys\UrlSigner\Middleware\AddLinkToRequest,
\Linkeys\UrlSigner\Middleware\AddLinkDataToRequest,
\Linkeys\UrlSigner\Middleware\CheckLinkUnchanged,
\Linkeys\UrlSigner\Middleware\CheckLinkValid
This could cause an issue since middleware order cannot be enforced.
Suggested Solution:
AddLinkDataToRequest
, CheckLinkUnchanged
, CheckLinkValid
to remove dependency on AddLinkToRequest
.The facade should potentially be renamed to UrlSigner to keep consistency throughout the project
The link table migration should optionally create foreign key constraints between the links and groups tables
Summary of the bug
Data is not accessible in controller
To Reproduce
$request->get('data');
Expected behaviour
The value of the 'data'
key to be returned.
Actual behaviour
null
was returned.
Additional context
The link is accessible in $request->get('link');
. It's just the data left.
Suggestion of a fix
Add a new middleware to inject the data into the request, not just the link.
Summary of the bug
I installed this package and ran the example:
$link = \Linkeys\UrlSigner\Facade\UrlSigner::generate('https://www.example.com/invitation');
echo $link; // https://www.example.com/invitation?uuid=UUID
This returns the Link instance as a JSON
string. And not the URL to use as shown in the example.
To Reproduce
Install package in Laravel 8 project, run:
$link = \Linkeys\UrlSigner\Facade\UrlSigner::generate('https://www.example.com/invitation');
echo $link; // https://www.example.com/invitation?uuid=UUID
and watch as it gives you a JSON
string.
Expected behaviour
Return string as shown.
Actual behaviour
Returns JSON
string.
What will the feature achieve?
Allow the upgrade of the Laravel framework to version 10
Why is this necessary?
Upgrade to Laravel 10
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.