-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Make parameter user mandatory for all methods in the auth manager interface
#45986
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
Conversation
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.
Unrelated to this PR but, ideally we'll want to update the def get_user from the simple auth manager I think.
Currently it uses the flask session object so we cannot use it outside the flask context. We have to manually use the core_api/security.py get_user function that retrieve the user from the token instead, which is working but being able to use the auth_manager interface is maybe more convenient ?
The method |
8caba96 to
ab29ae5
Compare
|
In Airflow 3 we do not use the session to store the user. Hence, there is no notion of "current user". Today, in the auth manager interface, all
is_authorized_*APIs have the parameteruseroptional. If not provided, the current user is used.This PR makes the parameter
userrequired in all APIs, I also added the parameter in some APIs where it was missing (batch_is_authorized_*APIs).Just one API/method in the auth manager will need some updates on that front as well:
def filter_permitted_menu_items(self, menu_items: list[MenuItem]) -> list[MenuItem]:. Actually, this API will need multiple updates because:MenuItemthat is a Flask object, we want to get rid of thatThis API will be updated in a future PR because I need to sync with the front-end team @bbovenzi and @pierrejeambrun to agree on a signature.
^ 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.rstor{issue_number}.significant.rst, in newsfragments.