jscheffl commented on code in PR #42049:
URL: https://github.com/apache/airflow/pull/42049#discussion_r1774010977


##########
airflow/providers/edge/plugins/edge_executor_plugin.py:
##########
@@ -0,0 +1,134 @@
+# 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.
+
+from __future__ import annotations
+
+from datetime import datetime, timedelta
+from pathlib import Path
+from typing import TYPE_CHECKING
+
+from connexion import FlaskApi
+from flask import Blueprint
+from flask_appbuilder import BaseView, expose
+from sqlalchemy import select
+
+from airflow.auth.managers.models.resource_details import AccessView
+from airflow.configuration import conf
+from airflow.exceptions import AirflowConfigException
+from airflow.models.taskinstance import TaskInstanceState
+from airflow.plugins_manager import AirflowPlugin
+from airflow.utils.session import NEW_SESSION, provide_session
+from airflow.utils.yaml import safe_load
+from airflow.www import utils as wwwutils
+from airflow.www.auth import has_access_view
+from airflow.www.constants import SWAGGER_BUNDLE, SWAGGER_ENABLED
+from airflow.www.extensions.init_views import 
_CustomErrorRequestBodyValidator, _LazyResolver
+
+if TYPE_CHECKING:
+    from sqlalchemy.orm import Session
+
+
+def _get_api_endpoints() -> Blueprint:
+    folder = Path(__file__).parents[1].resolve()  # this is 
airflow/providers/edge/
+    with folder.joinpath("openapi", "edge_worker_api_v1.yaml").open() as f:
+        specification = safe_load(f)
+    bp = FlaskApi(
+        specification=specification,
+        resolver=_LazyResolver(),
+        base_path="/edge_worker/v1",
+        options={"swagger_ui": SWAGGER_ENABLED, "swagger_path": 
SWAGGER_BUNDLE.__fspath__()},
+        strict_validation=True,
+        validate_responses=True,
+        validator_map={"body": _CustomErrorRequestBodyValidator},
+    ).blueprint
+    # Need to excemp CSRF to make API usable

Review Comment:
   fixed.



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