Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

In setup.py merge "signedtoken" extras into "rsa" extras so RSA features work #721

Open
@hoylen

Description

Describe the bug

The setup.py install script currently defines two "extras" that can be installed:

  • rsa which only installs PyCA's cryptography package, and
  • signedtoken which installs both cryptography and pyjwt packages.

oauthlib/setup.py

Lines 21 to 23 in d4716eb

rsa_require = ['cryptography']
signedtoken_require = ['cryptography', 'pyjwt>=1.0.0']
signals_require = ['blinker']

oauthlib/setup.py

Lines 40 to 44 in d4716eb

extras_require={
'rsa': rsa_require,
'signedtoken': signedtoken_require,
'signals': signals_require,
},

There are two problems with this.

Firstly, with the RSA-SHA1 signature method in OAuth 1.0a, having just cryptography without pyjwt does not work. It needs both. It is also needed for RS256 tokens in OAuth 2.0 too: JWT is needed/imported by oauth2/rfc6749/clients/service_application.py, common.py and oauth1/rfc5849/signature.py.

Secondly, the "signedtoken" extras is not documented (except buried in a section about errors in the FAQ). The "rsa" extras is partially documented, and that would mislead users into thinking all they need to do is install the "rsa" extras and RSA-SHA1 and RS256 will work.

How to reproduce

Install using pip install oauthlib[rsa] and try using the OAuth 1.0a RSA-SHA1 signature method. It fails with an exception, because pyjwt has not been installed.

ModuleNotFoundError: No module named 'jwt'

Expected behavior

Expect installing "rsa" will make the OAuth 1.0a RSA-SHA1 signature method work.

Proposed solution

Is there a reason why someone would what to install cryptography installed for RSA support, but cannot (or must not) install pyjwt?

Can both installation extras be merged into a single "rsa" extras? Having one option makes installing less complicated, and less things that need to be documented.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      AltStyle によって変換されたページ (->オリジナル) /