-
Notifications
You must be signed in to change notification settings - Fork 660
Fix signature validation #38
Fix signature validation #38
Conversation
@mpociot @freekmurze I would like to have your opinion. To correctly validate the signature we cannot have So to fix any extra parameter added to the request being ignored en thus rendering the signature invalid too I added those to a blacklist to be able to reconstruct the signature how it should be with params that are not route params. However this feels a bit dirty... we could also special case Let me know what you think on what route (heh, no pun intended) to take with this. |
# Conflicts: # tests/HttpApi/FetchChannelsTest.php
Rebased with master to fix conflicts. |
@stayallive You mention "After more testing this is broken since the route parameters are added as query params causing it to mess up the signature creation..." |
Please read my update: #38 (comment) It now works great, but not sure if there is a better way I'm missing. This still feels a bit wrong to me to whitelist/blacklist the query parameter names but I can see no way to (without rewriting the router and possibly things in Ratchet) to know which query params are coming from the route parameters and which come from the user. laravel-websockets/src/HttpApi/Controllers/Controller.php Lines 88 to 93 in 8f42479
|
@mpociot can you let me know what you plan is with this? 😄 Want to know if I need to merge 1.0.3 in my fork or if I can fix something to get this moving forward. |
@mpociot can you let me know what you plan is with this? 😄 |
I noticed that running this request to the websocket server yields an invalid signature error.
I noticed that the signatures are not generated as the Pusher lib and server expects/validates them.
So I fixed that and modified all tests to use the correct way (according to the
Pusher
library).Edit: After more testing this is broken since the route parameters are added as query params causing it to mess up the signature creation...
Edit edit: This now works like it should and ready for review