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

Add get_permitted_menu_items in auth manager #36871

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

vincbeck
Copy link
Contributor

Currently the menu in Airflow UI is using the filter is_menu_visible to display or not each menu item. Each call to is_menu_visible calls has_access which then call an is_authorized_ method from the auth manager used in the environment. Most likely, all auth managers (with the exception of fab) will call an external service for every is_authorized_ method. Today, displaying the menu call 26 times an is_authorized_ method which can be very expensive and make the Airflow UI slower.

Introducing get_permitted_menu_items which is responsible of returning the menu given user permissions can replace these 26 calls to one (if the service used by the auth manager is capable of multiple authz requests in one API).


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@boring-cyborg boring-cyborg bot added area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues kind:documentation labels Jan 18, 2024
@vincbeck vincbeck force-pushed the vincbeck/get_permitted_menu_items branch from 7c552f7 to ace2cc8 Compare January 18, 2024 16:51
@o-nikolas
Copy link
Contributor

Are you planning to add the override of that method for the amazon auth provider in a followup PR?

@potiuk potiuk merged commit a68c63f into apache:main Jan 19, 2024
55 checks passed
@vincbeck vincbeck deleted the vincbeck/get_permitted_menu_items branch February 6, 2024 15:31
@vincbeck
Copy link
Contributor Author

vincbeck commented Feb 6, 2024

Are you planning to add the override of that method for the amazon auth provider in a followup PR?

Yes

@ephraimbuddy ephraimbuddy added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) kind:documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants