https://github.com/apache/airflow/pull/27892 added Internal API as part of Webserver.

We need to introduce `airlfow internal-api` CLI command that starts Internal API as a independent component.
"""Initializes connection form"""
    from airflow.www.views import lazy_add_provider_discovered_options_to_connection_form
    lazy_add_provider_discovered_options_to_connection_form()
def init_error_handlers(app: Flask):
    """Add custom errors handlers"""
    from airflow.www import views
    app.register_error_handler(500, views.show_traceback)
    app.register_error_handler(404, views.not_found)
def set_cors_headers_on_response(response):
    """Add response headers"""
    allow_headers = conf.get("api", "access_control_allow_headers")
    allow_methods = conf.get("api", "access_control_allow_methods")
    allow_origins = conf.get("api", "access_control_allow_origins")
    if allow_headers:
        response.headers["Access-Control-Allow-Headers"] = allow_headers
    if allow_methods:
        response.headers["Access-Control-Allow-Methods"] = allow_methods
    if allow_origins == "*":
        response.headers["Access-Control-Allow-Origin"] = "*"
    elif allow_origins:
        allowed_origins = allow_origins.split(" ")
        origin = request.environ.get("HTTP_ORIGIN", allowed_origins[0])
        if origin in allowed_origins:
            response.headers["Access-Control-Allow-Origin"] = origin
    return response
def init_api_connexion(app: Flask) -> None: