openedx / openedx/openedx-platform
[Django4.2 upgrade]: Upgrade django-oauth-lib to latest 2.x.x version
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8.2k
- Forks
- 4.4k
- Avg merge
- 6d 18h
- Merged PRs (30d)
- 42
Description
Description
- A PR (link) was created in which we're unpinning django-oauth-toolket and oauthlib.
- The oauthlib has been updated successfully but for django-oauth-toolkit we faced some brokers. And we could only upgrade
django-oauth-toolkitto the latest1.x.xversion. - Our aim is to upgrade it to the latest
2.x.xversion.
Blocker
- The main blocker, we faced that in version
2.0.0,django-oauth-toolkitis saving theclient-secretas a hashed value instead of plain text.
https://django-oauth-toolkit.readthedocs.io/en/latest/changelog.html#id12:~:text=%231093%20(Breaking,before%20hitting%20Save - If we do any attempt to migrate DOT to 2.x.x, it will update all the existing client secrets as well.
- And then we can't downgrade its version. It's only one way.
raise IrreversibleError("Operation %s in %s is not reversible" % (operation, self))
django.db.migrations.exceptions.IrreversibleError: Operation <RunPython <function forwards_func at 0x7f6956652430>> in oauth2_provider.0006_alter_application_client_secret is not reversible
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with PR 32631 and the django-oauth-toolkit 2.0.0 changelog, then inspect oauth2_provider migration 0006_alter_application_client_secret referenced in the issue. Trace how existing client secrets are stored and how the migration affects them. Done means the project can use the latest 2.x version with an agreed migration path for existing secrets and its irreversible downgrade behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- authorization, backend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100