python-tent-client
python-tent-client copied to clipboard
Python 3 support
I've only tried this code on Python 2.6.1.
Do the dependencies support Python 3?
- requests: yes!
- macauthlib: not sure
I had a look and, no, the macauthlib is not compatible python 3. It fails almost every unittest when used with python 3. At least it's dependency WebOb is compatible python 3 so it shouldn't be impossible to port macauthlib.
Edit: actually it may not be a problem for a long time anymore :) https://github.com/mozilla-services/macauthlib/issues/4
Great!
Or if we decide to move away from macauthlib there was an almost-working attempt at MAC Authentication in an old version of our own code: https://github.com/longears/python-tent-client/blob/e6a2c32b7c0d81e8b6cd9fe1361578227f189d8e/tentapp.py#L33-71 The server never accepted it, though. I think the hostname might be thing that was wrong about it.
I just implemented authentication in PHP. If you don't mind, I could take a look at it. Then we can get rid of macauthlib and requests containing url-escaped chars should work.
Sure! _authHook would need to be updated to pull the hostname out of the request object and then sign it using the old MAC auth code.
I've got it working now, but got some git-issues. I'll fix them later tomorrow.