Check team permissions on bulk APIs for Connections, Variables and Pools#67293
Open
vincbeck wants to merge 1 commit into
Open
Check team permissions on bulk APIs for Connections, Variables and Pools#67293vincbeck wants to merge 1 commit into
vincbeck wants to merge 1 commit into
Conversation
| elif action.action == BulkAction.CREATE: | ||
| teams.add(entity_team_name) | ||
| if action.action_on_existence == BulkActionOnExistence.OVERWRITE: | ||
| teams.add(existing_team_name) |
Contributor
There was a problem hiding this comment.
I think existing_team_name will always be None here. The callers build the team mapping dict from a list that's filtered with if action.action != BulkAction.CREATE (e.g., line 449 for pools), which excludes all CREATE actions, including CREATE-with-overwrite. So the .get() call that populates existing_team_name never finds the key.
I believe the filters for pools, connections and variables need to also include CREATE-with-overwrite entities, something like:
if action.action != BulkAction.CREATE or action.action_on_existence == BulkActionOnExistence.OVERWRITE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When creating/updating connections, variables or pools through the bulk API, we currently no not check whether the user has access to team passed in the request body. Adding it now.
Was generative AI tooling used to co-author this PR?
Claude
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.