Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signature validation fails on some images, works on others #200

Closed
mpavey0 opened this issue Jun 29, 2017 · 0 comments
Closed

Signature validation fails on some images, works on others #200

mpavey0 opened this issue Jun 29, 2017 · 0 comments

Comments

@mpavey0
Copy link

mpavey0 commented Jun 29, 2017

Hi @reinink , first off thanks for this great library!

I've tried implementing the signature validation but am finding that for some requests it works fine, while others get a SignatureException error with the message Signature is not valid.. I've provided an example below. How can I debug this?

To be clear, the URLs for all these requests are being generated by my application using the URLBuilder and the same signature key, so they should all be valid. I can't discern any obvious pattern to which ones are passing and which are failing. Some of those failing have query string manipulation parameters (i.e. parameters other than s), some don't. I haven't yet seen any examples of images which are passing and have no manipulation params in the query string, though there may be some.

Could the fact that I am using defaults (fed into the ServerFactory) have any impact? If I've understood correctly, it shouldn't, since neither the URLBuilder nor the validation knows about them.

Example URI: /img/content_projects/ab682f3aeff7720c11c65a582de89ced.png?w=198&h=198&s=6aaa93dc4f54e9e02a6bd349652ab827
Error dump:

object(League\Glide\Signatures\SignatureException)#23 (7) { ["message":protected]=> string(23) "Signature is not valid." ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(67) "/var/www/gvip/gvip/vendor/league/glide/src/Signatures/Signature.php" ["line":protected]=> int(46) ["trace":"Exception":private]=> array(4) { [0]=> array(6) { ["file"]=> string(53) "/var/www/gvip/gvip/application/controllers/images.php" ["line"]=> int(56) ["function"]=> string(15) "validateRequest" ["class"]=> string(33) "League\Glide\Signatures\Signature" ["type"]=> string(2) "->" ["args"]=> array(2) { [0]=> string(60) "images/content_projects/ab682f3aeff7720c11c65a582de89ced.png" [1]=> array(3) { ["w"]=> string(3) "198" ["h"]=> string(3) "198" ["s"]=> string(32) "6aaa93dc4f54e9e02a6bd349652ab827" } } } [1]=> array(6) { ["file"]=> string(53) "/var/www/gvip/gvip/application/controllers/images.php" ["line"]=> int(27) ["function"]=> string(15) "validateRequest" ["class"]=> string(6) "Images" ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> string(60) "images/content_projects/ab682f3aeff7720c11c65a582de89ced.png" } } [2]=> array(6) { ["file"]=> string(46) "/var/www/gvip/gvip/system/core/CodeIgniter.php" ["line"]=> int(360) ["function"]=> string(4) "show" ["class"]=> string(6) "Images" ["type"]=> string(2) "->" ["args"]=> array(2) { [0]=> string(16) "content_projects" [1]=> string(36) "ab682f3aeff7720c11c65a582de89ced.png" } } [3]=> array(4) { ["file"]=> string(36) "/var/www/gvip/gvip/wwwroot/index.php" ["line"]=> int(145) ["args"]=> array(1) { [0]=> string(46) "/var/www/gvip/gvip/system/core/CodeIgniter.php" } ["function"]=> string(12) "require_once" } } ["previous":"Exception":private]=> NULL }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants