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

Remove django-allauth-2fa, dj-rest-auth and django-user-sessions #6293

Draft
wants to merge 121 commits into
base: master
Choose a base branch
from

Conversation

matmair
Copy link
Member

@matmair matmair commented Jan 19, 2024

This PR remove django-allauth-2fa and replaces it with the inline functions of django-allauth. This reduces the dependency footprint and eliminates a bunch of custom creations.

Update: Most of the planned things we would be interested in are now implemented and the scope shifted a bit - it makes sense to just ripp all auth extensions out and use only allauths built-in things. We have a lot of grown auth-adjacent code that can probably be removed/rewritten.

Closes #6281
Closes #8708

Todo:

  • refactor authentication forms && detection of enabled features (see 8912)
  • implement custom link target lookup for email from django-allauth
  • show user ID in MFA flow
  • implement email verification flow
  • re-implement registration flow
  • re-implement password reset flow
  • re-implement password change
  • keep auth context somewhere for the local session to refer back to
  • move now removed system status info into main status (registration, mfa, sso available)
  • switch back to browser flow for auth APIs
  • rename all new auth URLs to fix to the current schema
  • include schema for auth with central API
  • write changelog

Copy link

netlify bot commented Jan 19, 2024

Deploy Preview for inventree-web-pui-preview ready!

Name Link
🔨 Latest commit 5a07f48
🔍 Latest deploy log https://app.netlify.com/sites/inventree-web-pui-preview/deploys/6784bedf1ab87d0008920eef
😎 Deploy Preview https://deploy-preview-6293--inventree-web-pui-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 86 (no change from production)
Best Practices: 92 (🔴 down 8 from production)
SEO: 78 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@matmair matmair added dependency Relates to a project dependency security Relates to a security issue breaking Indicates a major update or change which breaks compatibility labels Jan 19, 2024
@matmair matmair self-assigned this Jan 19, 2024
@matmair matmair added this to the 0.14.0 milestone Jan 19, 2024
@matmair matmair modified the milestones: 0.14.0, 0.13.6, 0.15.0 Feb 12, 2024
@matmair
Copy link
Member Author

matmair commented Jan 8, 2025

@SchrodingersGat @wolflu05 this is getting close; if you have time I would appreciate feedback on this already

@SchrodingersGat
Copy link
Member

@matmair this looks like a fantastic improvement. I really appreciate that we can remove a lot of custom auth functionality here.

Have you performed any SSO testing as part of this? Is there any way that we can implement some automated CI testing of SSO auth somehow?

@matmair
Copy link
Member Author

matmair commented Jan 10, 2025

@SchrodingersGat I hope to get most if not all our custom things upstreamed - I am looking into contributing a few different things that we have built for ourselves up to django-allauth, send my first suggestion regarding this a few hours ago. This will help with better-separating concerns between different components.

I have tested SSO with GitHub and a few different OIDC providers extensively throughout working on this. We are not modifying the logic around this in any way so allauths tests should cover it. Adding CI testing would probably entail staging credentials for some provider into the CI - I am instinctively not a fan regarding this. I have not looked into that in more depth because we are just consuming the APIs.

@matmair
Copy link
Member Author

matmair commented Jan 12, 2025

All flows are now ported, now it is about cleanup and finishing a few smaller todos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Indicates a major update or change which breaks compatibility dependency Relates to a project dependency full-run Always do a full QC CI run security Relates to a security issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[UI] Multifactor token configuration Remove django-allauth-2fa
3 participants