-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
Fix and simplify get_permitted_dag_ids
in auth manager
#47458
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.
Just a question, it looks like before filter_permitted_dag_ids
and get_permitted_dag_ids
would return a dag id if we had read or write permission on it.
Now this is not the case anymore, we absolutely need the read
. Are we sure that existing installation always set "GET" access when they grant "PUT" access to a user, could that cause disruption ? For instance certain legacy endpoint would not specify the method, defaulting to GET
or PUT
.
No, if you pass method="PUT", you do not need read access, only the edit access. |
35d4d66
to
02dc9da
Compare
Maybe I got it wrong but that doesn't answer my question, before calling |
Oh! Got it! Yes you're right, but to be honest I think before was very wrong. Before, if you do not pass any methods to So I think we are solving a "bug" even though I am not sure this use case even exist (users having edit permissions but not read) |
Makes sense ! |
There is a bug currently in FAB auth manager. An error is thrown when trying to list DAGs with this following error:
This PR fixes the issue but more importantly, it simplifies the methods
get_permitted_dag_ids
andfilter_permitted_dag_ids
which were overly complicated for no reason.I also created tests for
get_permitted_dag_ids
in FAB auth manager.^ 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.