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

Remove a bunch of the wiki upload messages. #174

Merged
merged 1 commit into from Nov 17, 2014

Conversation

ralphbean
Copy link
Contributor

These have been giving us 'invalid signature' across the board forever
and I finally tracked it down. It has to do with how php incorrectly
sorts this inner dict -- at least, in a way different than Python does.
By removing it all together (except for the one attribute that we
actually use) it should squash those differences in the way php and
python compute the message signature.

These have been giving us 'invalid signature' across the board *forever*
and I finally tracked it down.  It has to do with how php incorrectly
sorts this inner dict -- at least, in a way different than Python does.
By removing it all together (except for the one attribute that we
actually use) it should squash those differences in the way php and
python compute the message signature.
@pypingou
Copy link
Member

Not sure I get the whole logic, but code wise it seems fine 👍

@ralphbean
Copy link
Contributor Author

Not sure I get the whole logic

Yeah, it's super weird. PHP and Python sort those dicts in different ways, so when they go to encode them as a JSON string they are in different orders. Since the strings are different, the crypto signatures are different. Since the signatures are different, the messages fail validation on receipt.

The best and right way to fix it would be to hack at PHP with a hammer until it sorts its nested dictionaries just like python does (so the strings come out the same way both times). But this is much easier -- I just remove the nested dict so the strings come out the same way regardless.

code wise it seems fine

Thanks :)

ralphbean added a commit that referenced this pull request Nov 17, 2014
Remove a bunch of the wiki upload messages.
@ralphbean ralphbean merged commit 681f485 into develop Nov 17, 2014
@ralphbean ralphbean deleted the feature/new-wiki-upload branch November 17, 2014 15:27
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

Successfully merging this pull request may close these issues.

None yet

2 participants