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

Fix DAG.access_control can't sync when clean access_control #30340

Merged
merged 3 commits into from
Apr 26, 2023

Conversation

huymq1710
Copy link
Contributor

@huymq1710 huymq1710 commented Mar 28, 2023

Closes: #25149

  • If a DAG’s access_control is empty, permission-sync is skipped entirely. I think it should check whether there’s existing permission configurations and reset those if needed instead.

@boring-cyborg boring-cyborg bot added the area:webserver Webserver related Issues label Mar 28, 2023
return True
return False

if dag.access_control or needs_perms(root_dag_id):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this if block completely so we sync perms in both cases. This is effectively reverting #15464.

Comment on lines +659 to +676
else:
resource = self.get_resource(dag_resource_name)
if resource:
_revoke_all_stale_permissions(resource)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a DAG’s access_control is empty, it check whether there’s existing permission configurations and reset those

@tvd12
Copy link

tvd12 commented Mar 31, 2023

Do you have any plan to merge it? I need this one for my project :(

@eladkal eladkal added this to the Airflow 2.5.4 milestone Apr 4, 2023
@huymq1710
Copy link
Contributor Author

This PR is ready for review

@eladkal eladkal added the type:bug-fix Changelog: Bug Fixes label Apr 21, 2023
Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. But I know very little about that part of the codebase. @ephraimbuddy @kaxil @uranusjr - I think you've been doing some "real fixes" around that - maybe second opinon there?

@potiuk potiuk merged commit 2c0c8b8 into apache:main Apr 26, 2023
42 checks passed
@boring-cyborg
Copy link

boring-cyborg bot commented Apr 26, 2023

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

eladkal pushed a commit that referenced this pull request Jun 8, 2023
* Reset permission if `access_control` is empty

* Check `resource` before call `_revoke_all_stale_permissions`

* Fix static checks

(cherry picked from commit 2c0c8b8)
@huymq1710
Copy link
Contributor Author

Update: #33632

@huymq1710 huymq1710 deleted the fix#25149 branch November 22, 2023 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:webserver Webserver related Issues type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DAG.access_control can't sync when clean access_control
5 participants