Switch to use oauthlib instead of oauth2#101
Conversation
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| - | - | Generic Private Key | 88ce21c | pylti/tests/data/certs/snakeoil.pem | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
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.