-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Fix ApprovalOperator with SimpleAuthManager when all_admins=True #59399
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
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
jason810496
left a comment
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.
Nice! Thanks for the fix and it LGTM overall.
airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py
Outdated
Show resolved
Hide resolved
providers/amazon/src/airflow/providers/amazon/aws/auth_manager/aws_auth_manager.py
Outdated
Show resolved
Hide resolved
jason810496
left a comment
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.
Thanks for the update!
Also that is a new functionality and some thinking on how we communicatee it (newsfragment) and what should be default behaviour for Auth Managers that do not implement it should be.
It would be nice to add the 59399.feature.rst newsfragment from airflow-core/newsfragments/template.significant.rst template.
Thanks!
airflow-core/src/airflow/api_fastapi/auth/managers/simple/simple_auth_manager.py
Outdated
Show resolved
Hide resolved
|
Thanks, will do after a long haul flight. |
airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/auth/managers/simple/simple_auth_manager.py
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py
Outdated
Show resolved
Hide resolved
|
Some comments but the overall direction is good I think |
|
Please also update documentation to mention this new API in |
Lee-W
left a comment
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.
overall looks good. But would like to confirm with @vincbeck whether it's possible to have more than one user with the same ID (I guess not?) if so, should we use id, name pair to check instead
Nope. you can't. User_id uniquely identifies user in AuthManager. |
|
Looks way better now :) |
af780b0 to
11af683
Compare
pierrejeambrun
left a comment
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.
LGTM
vincbeck
left a comment
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.
2 nits but overall looks very good!
@Lee-W Hi! I rebased |
jason810496
left a comment
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.
@Lee-W Hi! I rebased fix-hitl-auth onto main to keep it up to date, which automatically triggered additional review requests.
Just wanted to check if this rebase looks correct. Thanks!
Thanks for the rebase. We still need to resolve the conflicts again. Thanks!
Fixes apache#59348. Added is_allowed() method to BaseAuthManager and all implementations to properly delegate HITL permission checks. - SimpleAuthManager: Returns True when simple_auth_manager_all_admins=True - Other managers: Check if user is in assigned_users list - Updated hitl.py to use auth manager's is_allowed() method Remove duplicate import
…onsistency and remove redundant code
- Update method to use keyword-only parameters - Take full user object instead of just user_id - Add unit tests for BaseAuthManager and SimpleAuthManager - Update hitl.py call site to match new signature
Fixes apache#59348. Added is_allowed() method to BaseAuthManager and all implementations to properly delegate HITL permission checks. - SimpleAuthManager: Returns True when simple_auth_manager_all_admins=True - Other managers: Check if user is in assigned_users list - Updated hitl.py to use auth manager's is_allowed() method Remove duplicate import
…onsistency and remove redundant code
- Update method to use keyword-only parameters - Take full user object instead of just user_id - Add unit tests for BaseAuthManager and SimpleAuthManager - Update hitl.py call site to match new signature
Co-authored-by: Vincent <97131062+vincbeck@users.noreply.github.com>
…m authorization logic for HITL tasks
65f58ed to
dbc6f74
Compare
jason810496
left a comment
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.
Thanks for the update! LGTM if CI pass.
I just added backport label to 3.1.6, we can close the backport one if we only want to release in 3.2.0.
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
Backport failed to create: v3-1-test. View the failure log Run details
You can attempt to backport this manually by running: cherry_picker d95d8ba v3-1-testThis should apply the commit to the v3-1-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continue |
…ns=True (apache#59399) (cherry picked from commit d95d8ba) Co-authored-by: Victor Kwong <109138344+TempestShaw@users.noreply.github.com> Co-authored-by: Vincent <97131062+vincbeck@users.noreply.github.com>
…che#59399) Co-authored-by: Vincent <97131062+vincbeck@users.noreply.github.com>
…che#59399) Co-authored-by: Vincent <97131062+vincbeck@users.noreply.github.com>
…che#59399) Co-authored-by: Vincent <97131062+vincbeck@users.noreply.github.com>
Fixes #59348. Added is_allowed() method to BaseAuthManager and all
implementations to properly delegate HITL permission checks.