Switch to use oauthlib instead of oauth2 #101
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What are the relevant tickets?
#78
What does this PR do?
This pull request drops the unmaintained oauth2 library in favor of oauthlib, which is maintained and appears to be more robust. In the process, this drops support for older versions of Python, now requiring 3.7+.
How should this be manually tested?
All tests pass. I've manually tested it with Python 3.7, 3.8, 3.9, 3.10, and 3.11.
Where should the reviewer start?
All substantial code changes are in
pylti/common.py
. Most large removals are removing workarounds for bugs in oauth2 that are now not needed.I tried to stick as close to oauth2's implementation as possible. This includes not recording nonces to check for reuse, which is a security issue, but no worse than it was before. (And fwiw, while the LTI spec says that tool providers "should keep a record of nonces received," it also talks about an implementation detail "if you do not record nonces" as well.)
The rest is minor test cleanup, dependency updates, etc.
I'd be happy to make further commits for style or correctness.