-
Notifications
You must be signed in to change notification settings - Fork 16.6k
feat(embedded): add feature flag to disable logout button in embedded contexts #37537
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
base: master
Are you sure you want to change the base?
feat(embedded): add feature flag to disable logout button in embedded contexts #37537
Conversation
Code Review Agent Run #9e3d06Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #37537 +/- ##
===========================================
+ Coverage 0 66.58% +66.58%
===========================================
Files 0 643 +643
Lines 0 49051 +49051
Branches 0 5500 +5500
===========================================
+ Hits 0 32662 +32662
- Misses 0 15094 +15094
- Partials 0 1295 +1295
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ployments The logout link was missing the ensureAppRoot wrapper that other internal URLs (like user_info_url) already use, causing logout to 404 in subdirectory deployments.
Code Review Agent Run #9724c4Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
| ), | ||
| onClick: handleLogout, | ||
| }); | ||
| if (!isFeatureEnabled(FeatureFlag.DisableEmbeddedSupersetLogout)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't more aligned with our existing patterns to use a permission for hide/show a menu? Was there any reason why that wouldn't work on embedded envs?
SUMMARY
This PR introduces a new feature flag
DISABLE_EMBEDDED_SUPERSET_LOGOUTthat hides the logout button when Superset is embedded via iframe in SSO-managed authentication flows.Use Case: When Superset is embedded within a parent application that manages authentication via SSO, the logout button in Superset becomes problematic:
Solution: A feature flag that conditionally hides the logout menu item in the Settings dropdown, allowing administrators to disable logout functionality in embedded deployments while preserving it for standalone use.
Changes:
superset/config.py): AddedDISABLE_EMBEDDED_SUPERSET_LOGOUTtoDEFAULT_FEATURE_FLAGSwith default valueFalse, including@docsannotation linking to documentationfeatureFlags.ts): AddedDisableEmbeddedSupersetLogoutTypeScript enum entryRightMenu.tsx): Wrapped logout menu item in conditional check usingisFeatureEnabled()RightMenu.test.tsx): Added 2 new tests covering both enabled and disabled statesdocs/docs/configuration/networking-settings.mdx): Added "Hiding the Logout Button in Embedded Contexts" section under HTML EmbeddingBEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
BEFORE (Flag Disabled - Default Behavior):
Settings menu shows the Logout option as expected.
AFTER (Flag Enabled):
Settings menu no longer shows the Logout option - users must log out through the parent application.
TESTING INSTRUCTIONS
Unit Tests
All 9 tests pass, including:
shows logout button when DISABLE_EMBEDDED_SUPERSET_LOGOUT is falsehides logout button when DISABLE_EMBEDDED_SUPERSET_LOGOUT is trueManual Testing
Test with flag disabled (default):
Test with flag enabled:
superset_config.py:Test in iframe context:
ADDITIONAL INFORMATION
DISABLE_EMBEDDED_SUPERSET_LOGOUT