-
Notifications
You must be signed in to change notification settings - Fork 143
Update django-oauth-toolkit #2710 #2726
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
Update django-oauth-toolkit #2710 #2726
Conversation
Remove pinning for django-oauth-toolkit and remove explicit declaration of oauthlib as it is a dependency of django-oauth-toolkit. Re-address prior work-around for older oauth2_provider migration file silently failing to apply and holding up all subsequent oauth2_provider migrations, as this migration file, and a few subsequent ones, have now been squashed upstream. "oauth2_provider" is part of django-oauth-toolkit. Added dev logging for before/after our migration in this area.
|
Presented as draft as we have, likely, some new incompatibilities introduced as indicated in the associated issue. One development db instance (potentially partially migrated) shows a failure in rockstor-bootstrap.service with: with our /opt/rockstor/var/log/gunicorn.log mirroring this similarly: |
|
|
From the linked issue we have:
https://django-oauth-toolkit.readthedocs.io/en/latest/changelog.html#id1
|
|
Contextual files:
|
|
Errors come from (slightly modified now): src/rockstor/cli/api_wrapper.py |
Is not enough in this case so it looks like we are now doing-it-wrong re secrets handling for 2.0.0. |
|
In the new 2.* oath2_provider the 'secret' is not longer usable directly from the db:
As it is now saved as a hash: point 2 as quoted from changelog in #2726 (comment) |
|
Notes: |
As from Django Oauth Toolkit 2.x onwards, Oauth app client_secret is hashed within dd, dictating that we can no longer source this secret from the db for our internal cli client app token requests. Move to establishing a dynamic Oathapp client_secret, established in settings.py, and reset by rockstor-bootstrap.service. # Includes - Adding a requests timeouts to client token requests. - Arbitrary fsting application. - Update disk, pool, share, snap state every 20s not every minute. - Abandon bootstrap after 10, not 15 attempts.
|
With the proposed fixes & modification in the associated branch we now have: Ongoing while there is a logged in user. It seems that, as from Djanog Oauth Toolkit 2.x onwards we can no longer retrieve our Oauth app client secret, for token retrieval authentication, directly from the database; as we have been doing to date. So I'm proposing here we move to establishing a systemd session (rockstor-bootstrap) established Oauth client_secret setup. |
|
A little more testing to do here as-of-yet, but with this approach we can move to using the latest Django Oauth Toolkit rather than having to pin to a pre 2.x version which would ultimately restict our other developments in time and cut us off from current and future security enhancements that the newer version of this Oauth provider library has to offer. |
|
|
Moving to squash and republish for cleaner Git history history. |
Remove pinning for django-oauth-toolkit and remove explicit declaration of oauthlib as it is a
dependency of django-oauth-toolkit.
Re-address prior work-around for older oauth2_provider migration file silently failing to apply and holding up all subsequent oauth2_provider migrations, as this migration file, and a few subsequent ones, have now been squashed upstream. "oauth2_provider" is part of django-oauth-toolkit.
Added dev logging for before/after our migration in this area.