github-advanced-security[bot] commented on code in PR #75337:
URL: https://github.com/apache/airflow/pull/75337#discussion_r4339953617


##########
airflow-core/src/airflow/webhooks/asset_routes.py:
##########
@@ -0,0 +1,323 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""
+Asset routes: the events a delivery records on data assets that its webhook's 
connection names.
+
+A route in ``asset_routes`` of the connection's extra has each delivery 
offered its topic name also
+record an event on its asset, as topic events are recorded: only for a Dag 
that the event can queue, in
+the delivery's transaction, and from a webhook without a team.
+"""
+
+from __future__ import annotations
+
+import enum
+import re
+from dataclasses import dataclass, field
+from typing import TYPE_CHECKING, Any, TypedDict
+
+from sqlalchemy import and_, or_, select
+
+from airflow.assets.manager import asset_manager
+from airflow.configuration import conf
+from airflow.models.asset import AssetActive, AssetModel
+from airflow.models.base import ID_LEN
+from airflow.models.inbound_delivery import DeliveryOutcome
+from airflow.serialization.definitions.assets import SerializedAssetUniqueKey
+from airflow.utils.sqlalchemy import get_dialect_name
+from airflow.webhooks.base import get_field
+from airflow.webhooks.topics import build_dag_has_team_clause, 
build_event_extra, select_scheduling_dags
+
+if TYPE_CHECKING:
+    from collections.abc import Callable, Collection, Sequence
+    from uuid import UUID
+
+    from sqlalchemy import Row
+    from sqlalchemy.orm import Session
+
+    from airflow.models.asset import AssetEvent
+    from airflow.webhooks.base import WebhookDelivery
+    from airflow.webhooks.connections import AssetRoute, ConfiguredWebhook
+
+# PostgreSQL stores neither U+0000 nor an unpaired surrogate as text, and 
MySQL stores partition keys as
+# utf8mb3, which has no character outside the Basic Multilingual Plane, such 
as an emoji.
+_UNSTORABLE_KEY_CHARACTER = 
re.compile("[\x00\ud800-\udfff\U00010000-\U0010ffff]")

Review Comment:
   ## CodeQL / Overly permissive regular expression range
   
   Suspicious character range that overlaps with \ufffd-\ufffd in the same 
character class.
   
   [Show more 
details](https://github.com/apache/airflow/security/code-scanning/682)



-- 
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]

Reply via email to