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

Implement a dedicated plugin for SSO functionalities #475

Merged
merged 15 commits into from
Dec 17, 2024

Conversation

HungNgien
Copy link
Contributor

@HungNgien HungNgien commented Dec 12, 2024

Add UI for setting page of generating sso keys
image

Add sign-in buttons for MediaWiki, Google and Github
image

This PR resolves #454

Summary by Sourcery

Implement a dedicated plugin for SSO functionalities, including UI for generating SSO keys and sign-in buttons for MediaWiki, Google, and GitHub. Enhance the global settings with SSO configuration capabilities and update project dependencies to support social authentication.

New Features:

  • Introduce a dedicated plugin for Single Sign-On (SSO) functionalities, allowing users to log in using MediaWiki, Google, and GitHub accounts.
  • Add a new UI for generating SSO keys, providing a user-friendly interface for managing OAuth applications.

Enhancements:

  • Enhance the global settings view by adding a new SSO configuration form and view, enabling administrators to manage OAuth applications directly from the admin panel.

Build:

  • Add 'django-allauth' and its social account providers to the project dependencies, facilitating social authentication.

Copy link

sourcery-ai bot commented Dec 12, 2024

Reviewer's Guide by Sourcery

This PR implements a dedicated SSO (Single Sign-On) plugin that enables social login functionality through MediaWiki, Google, and GitHub. The implementation includes a new UI for managing OAuth applications and keys, integration with Django Allauth for social authentication, and the necessary backend infrastructure to support these features.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Added SSO management interface in the admin panel
  • Created new SSOView class to handle OAuth application management
  • Implemented form for generating new OAuth applications
  • Added interface for viewing and deleting existing OAuth applications
  • Created template for SSO management page
src/pretix/control/views/global_settings.py
src/pretix/control/forms/global_settings.py
src/pretix/control/templates/pretixcontrol/global_sso.html
src/pretix/control/urls.py
src/pretix/control/navigation.py
Implemented social authentication plugin infrastructure
  • Created custom social account adapter for handling authentication errors
  • Implemented authentication backends for MediaWiki, Google, and GitHub
  • Added OAuth return view for handling social login callbacks
  • Set up plugin configuration and initialization
src/pretix/plugins/socialauth/adapter.py
src/pretix/plugins/socialauth/backends.py
src/pretix/plugins/socialauth/views.py
src/pretix/plugins/socialauth/apps.py
src/pretix/plugins/socialauth/urls.py
Configured Django Allauth integration
  • Added Django Allauth and its social account providers to installed apps
  • Configured authentication backends to include Allauth
  • Set up social account provider settings for MediaWiki, Google, and GitHub
  • Added Allauth URL patterns
src/pretix/settings.py
src/pretix/urls.py
pyproject.toml

Assessment against linked issues

Issue Objective Addressed Explanation
#454 Implement SSO functionality in a dedicated plugin with support for eventyay-talk and video
#454 Add support for additional SSO providers (Wikipedia/Wikimedia, Google, GitHub)
#454 Add a section in the admin dashboard for SSO configuration

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@HungNgien HungNgien marked this pull request as ready for review December 12, 2024 14:22
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @HungNgien - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider adding user feedback for authentication failures instead of silently redirecting to index in the CustomSocialAccountAdapter
  • Add a confirmation dialog before allowing OAuth application deletion to prevent accidental removals
Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

src/pretix/control/views/global_settings.py Show resolved Hide resolved
src/pretix/control/views/global_settings.py Outdated Show resolved Hide resolved
src/pretix/control/views/global_settings.py Outdated Show resolved Hide resolved
src/pretix/control/views/global_settings.py Outdated Show resolved Hide resolved
src/pretix/control/views/global_settings.py Outdated Show resolved Hide resolved
src/pretix/plugins/socialauth/backends.py Outdated Show resolved Hide resolved
@mariobehling mariobehling requested a review from odkhang December 15, 2024 20:43
@mariobehling mariobehling merged commit 6746eef into fossasia:development Dec 17, 2024
4 of 5 checks passed
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.

Implement a dedicated plugin for SSO functionalities
4 participants