[fix] Allowed managing social auth secrets when needed#500
Conversation
📝 WalkthroughWalkthroughThe changes introduce a new setting Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@openwisp_users/settings.py`:
- Around line 54-61: Respect an explicit settings override before auto-detecting
providers: first check getattr(settings, "SOCIALACCOUNT_ADMIN_NEEDED", None) and
if it is not None use that boolean value; otherwise fall back to the existing
detection logic on settings.INSTALLED_APPS (the any(...) check for
app.startswith("allauth.socialaccount.providers")) but also support an optional
settings.SOCIALACCOUNT_PROVIDER_APPS list (if present) and treat
SOCIALACCOUNT_ADMIN_NEEDED as True if any entry from that list is present in
INSTALLED_APPS; update the assignment to SOCIALACCOUNT_ADMIN_NEEDED accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 6f7a1925-6150-4ef4-89dc-549660687229
📒 Files selected for processing (2)
openwisp_users/admin.pyopenwisp_users/settings.py
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (17)
- GitHub Check: Python==3.11 | django~=5.2.0
- GitHub Check: Python==3.13 | django~=5.1.0
- GitHub Check: Python==3.12 | django~=5.2.0
- GitHub Check: Python==3.12 | django~=4.2.0
- GitHub Check: Python==3.11 | django~=5.0.0
- GitHub Check: Python==3.12 | django~=5.0.0
- GitHub Check: Python==3.10 | django~=5.2.0
- GitHub Check: Python==3.10 | django~=5.1.0
- GitHub Check: Python==3.13 | django~=5.2.0
- GitHub Check: Python==3.10 | django~=4.2.0
- GitHub Check: Python==3.10 | django~=5.0.0
- GitHub Check: Python==3.12 | django~=5.1.0
- GitHub Check: Python==3.11 | django~=4.2.0
- GitHub Check: Python==3.11 | django~=5.1.0
- GitHub Check: Analyze (python)
- GitHub Check: Analyze (actions)
- GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
📄 CodeRabbit inference engine (Custom checks)
For Django pull requests, ensure all user-facing strings are marked as translatable using the Django i18n framework (django.utils.translation.gettext, gettext_lazy, or ugettext aliases)
Files:
openwisp_users/admin.pyopenwisp_users/settings.py
🧠 Learnings (1)
📓 Common learnings
Learnt from: pandafy
Repo: openwisp/openwisp-users PR: 0
File: :0-0
Timestamp: 2026-04-14T18:12:00.871Z
Learning: In openwisp/openwisp-users, the `password` field (Django hashed password) has been included in the default `EXPORT_USERS_COMMAND_CONFIG["fields"]` since before PR `#498`. Flagging it as a security concern in the context of this PR is out of scope as it is a pre-existing configuration choice.
🔇 Additional comments (1)
openwisp_users/admin.py (1)
655-662: LGTM:SocialAppis now preserved only when credentials need admin management.The unregister loop remains safe via
is_registered, and this keeps the admin UI simplified when no provider admin is needed.
Flake8 F401 Errors in Multiple JobsHello @nemesifier, The CI failed due to To fix this:
If the import is still needed for other reasons, ensure that |
Before, OpenWISP Users removed the ``allauth.socialaccount`` admin sections to keep the admin UI simple, but over time more users need this to support OAuth/SAML authentication to the admin interface (manage app secrets). With this change, the admin allows managing app secrets if any ``allauth.socialaccount.provider`` is installed, eg: microsoft, google, openid, etc.
5b656ab to
655b31f
Compare
|
/backport 1.2 |
Before, OpenWISP Users removed the
allauth.socialaccountadmin sections to keep the admin UI simple, but over time more users need this to support OAuth/SAML authentication to the admin interface (manage app secrets).With this change, the admin allows managing app secrets if any
allauth.socialaccount.provideris installed, eg: microsoft, google, openid, etc.Checklist