stegololz commented on code in PR #61256:
URL: https://github.com/apache/airflow/pull/61256#discussion_r2773420269
##########
providers/keycloak/src/airflow/providers/keycloak/auth_manager/keycloak_auth_manager.py:
##########
@@ -208,29 +224,41 @@ def is_authorized_dag(
details: DagDetails | None = None,
) -> bool:
dag_id = details.id if details else None
+ team_name = details.team_name if details else None
access_entity_str = access_entity.value if access_entity else None
return self._is_authorized(
method=method,
resource_type=KeycloakResource.DAG,
user=user,
resource_id=dag_id,
+ team_name=team_name,
attributes={"dag_entity": access_entity_str},
)
def is_authorized_backfill(
self, *, method: ResourceMethod, user: KeycloakAuthManagerUser,
details: BackfillDetails | None = None
) -> bool:
backfill_id = str(details.id) if details else None
+ team_name = getattr(details, "team_name", None) if details else None
return self._is_authorized(
- method=method, resource_type=KeycloakResource.BACKFILL, user=user,
resource_id=backfill_id
+ method=method,
+ resource_type=KeycloakResource.BACKFILL,
+ user=user,
+ resource_id=backfill_id,
+ team_name=team_name,
)
def is_authorized_asset(
self, *, method: ResourceMethod, user: KeycloakAuthManagerUser,
details: AssetDetails | None = None
) -> bool:
asset_id = details.id if details else None
+ team_name = getattr(details, "team_name", None) if details else None
return self._is_authorized(
- method=method, resource_type=KeycloakResource.ASSET, user=user,
resource_id=asset_id
+ method=method,
+ resource_type=KeycloakResource.ASSET,
+ user=user,
+ resource_id=asset_id,
+ team_name=team_name,
)
def is_authorized_asset_alias(
Review Comment:
We did not teamify assetalias to match auth manager model.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]