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

Support for App Engine #99

Closed
garyp opened this issue Mar 14, 2015 · 7 comments
Closed

Support for App Engine #99

garyp opened this issue Mar 14, 2015 · 7 comments
Milestone

Comments

@garyp
Copy link

garyp commented Mar 14, 2015

Google App Engine's python runtime environment unfortunately only supports the "pycrypto" library and not the newer "cryptography" library (they have a pre-vetted list of native libraries that are supported): https://cloud.google.com/appengine/docs/python/tools/libraries27. I'm using the 0.3.x branch of pyjwt on App Engine right now and it'd be nice to be able to ugprade to 0.4.x.

The only solution I can think of is to bring back the old pycrypto code and use it as a fallback when the "cryptography" library isn't available. If you're ok with continuing to support pycrypto within pyjwt, I don't mind putting together a pull request to implement the fallback logic.

@jpadilla
Copy link
Owner

GAE strikes again! Are you using RSA or ECDSA signatures? If not you wouldn't need pycypto or cryptography at all. I think we could definitely evaluate the possibilities of abstracting both libraries, and support both of them without including too much about each in our implementation. Does that make sense?

@garyp
Copy link
Author

garyp commented Mar 14, 2015

I'm using RS256 signatures. Yeah, abstracting both libraries is what I was thinking. The code already seems pretty well abstracted, so it doesn't seem like it'd be a lot of work to define a common interface.

@jpadilla
Copy link
Owner

@garyp I'm down to seeing a proposal for this.

@garyp
Copy link
Author

garyp commented Mar 15, 2015

@jpadilla Great. I'll probably work on this in a week or two.

@mark-adams
Copy link
Contributor

This can now be accomplished by using register_algorithm and the and the jwt.contrib.algorithms.pycrypto classes.

I'd say this is resolved @jpadilla

@johnlockwood-wf
Copy link

@mark-adams, how do you use register_algorithm with the jwt.contrib algorithms? When I python setup.py install, there is no contrib package in jwt.

@johnlockwood-wf
Copy link

this seems to be an issue with the setup.py. It needs to list all the packages like:

setup(
    name='PyJWT',
    ...
    packages=['jwt', 'jwt.contrib', 'jwt.contrib.algorithms'],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants