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

Switch to use oauthlib instead of oauth2 #101

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

liffiton
Copy link

@liffiton liffiton commented May 9, 2023

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?

pip install -r requirements.txt
pytest

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.

@gitguardian
Copy link

gitguardian bot commented May 9, 2023

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id Secret Commit Filename
- Generic Private Key 88ce21c pylti/tests/data/certs/snakeoil.pem View secret
- RSA Private Key 88ce21c pylti/tests/data/certs/snakeoil.pem View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. 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


🦉 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.

Our GitHub checks need improvements? Share your feedbacks!

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

Successfully merging this pull request may close these issues.

1 participant