Repository navigation
chore(deps): bump flask-appbuilder from 5.2.2 to 5.2.3 - #44400
Merged
Merged
Conversation
Flask-AppBuilder 5.2.3 distinguishes authentication from authorization in has_access: an authenticated, active user failing the permission check is now forbidden rather than redirected to the login view. Pin both halves of that distinction.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #44400 +/- ##
==========================================
- Coverage 80.41% 80.41% -0.01%
==========================================
Files 2932 2932
Lines 174621 174621
Branches 40559 40559
==========================================
- Hits 140422 140416 -6
- Misses 31532 31538 +6
Partials 2667 2667
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Vitor-Avila
approved these changes
Sep 17, 2026
Contributor
|
Bito Automatic Review Skipped – PR Already Merged |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUMMARY
Bumps
flask-appbuilderfrom 5.2.2 to 5.2.3.Diffing the two sdists, the release contains exactly two functional changes; every
other changed file (
baseviews.py,cli.py,widgets.py,views.py,filemanager.py,models/mixins.py,_compat.py, …) is reformatting from a newerblack.1.
AuthView._get_safe_next_url()(security/views.py)A new helper,
get_safe_redirect(request.args.get("next", self.appbuilder.get_url_for_index)),is applied at the five "already authenticated" early-return sites in
AuthDBView,AuthLDAPView,AuthOAuthView,AuthOIDViewandAuthRemoteUserView.Those sites previously redirected unconditionally to the index.
This is inert for Superset:
SupersetAuthView(superset/views/auth.py) overrideslogin()and is registered at/login/for every auth type exceptAUTH_REMOTE_USER(
SupersetSecurityManager.register_views), so FAB's own login views never handle theroute and the helper is never called.
AUTH_REMOTE_USER— the one case where FAB's view does claim the route — 5.2.2already did
redirect(get_safe_redirect(request.args.get("next", ""))), andget_safe_redirect("")already fell back toget_url_for_index. The refactor isbehaviour-preserving there.
2.
has_accessnow returns 403 for authorization failures (security/decorators.py)This one is live in Superset:
has_accessis imported from Flask-AppBuilder directlyat ~42 legacy view methods and is not overridden.
current_user.is_authenticated and current_user.is_active, so anonymous requests stillget the flash and the 302 to the login view with
next=.view (which, being already authenticated, bounced them on to the index with a flash).
That is the intended fix upstream — an authenticated user failing an authorization check
is not an authentication problem and should not be sent to a login page — and it matches
what Superset's own view code already does (
superset/views/core.pyredirects to loginonly when there is no current user, and otherwise aborts).
One consequence worth flagging for reviewers: Superset registers no 403 error page, and
show_http_exception(superset/views/error_handling.py) only serves a static HTML pagefor 404 and 500. A browser navigating to a legacy view the logged-in user lacks permission
for will therefore render a JSON error body rather than an HTML page. Adding a 403 static
page alongside the existing
404.html/500.htmlwould be a reasonable follow-up; it isleft out of this PR to keep the bump reviewable on its own.
No configuration changes are required by this bump.
One existing test asserted the old behaviour and is updated here:
tests/integration_tests/sqllab_tests.py::TestSqlLab::test_sqllab_no_accesslogs in asGamma, requests
/sqllab/and/sqllab/history/, and asserted302("Redirects to themain page"). That is precisely the case above, so it now asserts
403. A companiontest_sqllab_no_access_anonymousis added to pin the other half of the distinction —logged out, the same endpoints still redirect to the login view.
TESTING INSTRUCTIONS
The pinned files were regenerated with the repo's own tooling rather than hand-edited:
# after bumping the floor in pyproject.toml ./scripts/uv-pip-compile.shThat produced a one-line change in each of
requirements/base.txtandrequirements/development.txtand no transitive drift — 5.2.3 leavesinstall_requiresuntouched, so nothing else in the resolution moves.
To exercise the behaviour change above:
/sqllab/).403; before this bump the response was a302to/login/?next=…, which thenredirected on to the index.
302to the login view.CI is the verification for the suite as a whole; this is a dependency bump, so the backend
unit and integration jobs are the relevant signal. The first run surfaced exactly one
failure,
test_sqllab_no_access(assert 302 == 403) in thetest-postgres-hiveandtest-postgres-prestolegs, which is the test updated above.ADDITIONAL INFORMATION