mirror of
https://github.com/langgenius/dify.git
synced 2026-05-20 08:46:57 +08:00
Removes /openapi/v1/apps/<id>/{chat-messages,completion-messages,
workflows/run}. Bearer surface for runs is now the unified /run route
(api-3). Service-API /v1/* per-mode routes (app-key auth) untouched.
Also deletes the corresponding unit test files
(test_chat_messages.py, test_completion_messages.py, test_workflow_run.py)
which targeted the removed handlers; coverage of the unified route lives
in tests/unit_tests/controllers/openapi/test_app_run_dispatch.py and
tests/integration_tests/controllers/openapi/test_app_run.py.
42 lines
792 B
Python
42 lines
792 B
Python
from flask import Blueprint
|
|
from flask_restx import Namespace
|
|
|
|
from libs.device_flow_security import attach_anti_framing
|
|
from libs.external_api import ExternalApi
|
|
|
|
bp = Blueprint("openapi", __name__, url_prefix="/openapi/v1")
|
|
attach_anti_framing(bp)
|
|
|
|
api = ExternalApi(
|
|
bp,
|
|
version="1.0",
|
|
title="OpenAPI",
|
|
description="User-scoped programmatic API (bearer auth)",
|
|
)
|
|
|
|
openapi_ns = Namespace("openapi", description="User-scoped operations", path="/")
|
|
|
|
from . import (
|
|
account,
|
|
app_run,
|
|
apps,
|
|
apps_permitted,
|
|
index,
|
|
oauth_device,
|
|
oauth_device_sso,
|
|
workspaces,
|
|
)
|
|
|
|
__all__ = [
|
|
"account",
|
|
"app_run",
|
|
"apps",
|
|
"apps_permitted",
|
|
"index",
|
|
"oauth_device",
|
|
"oauth_device_sso",
|
|
"workspaces",
|
|
]
|
|
|
|
api.add_namespace(openapi_ns)
|