mirror of
https://github.com/langgenius/dify.git
synced 2026-05-20 16:57:01 +08:00
Same pattern as B.6 / B.7: OAuthDeviceLookupApi moves to controllers/openapi/oauth_device/lookup.py and is re-registered on service_api_ns to keep /v1/oauth/device/lookup serving until Phase F. service_api/oauth.py is now down to /me + /oauth/authorizations/self plus three legacy mounts; remaining handlers move in Phase C. Now-unused imports (LIMIT_LOOKUP_PUBLIC, rate_limit, reqparse, request, DEVICE_FLOW_TTL_SECONDS, DeviceFlowRedis, DeviceFlowStatus) removed. Plan: docs/superpowers/plans/2026-04-26-openapi-migration.md (in difyctl repo).
30 lines
703 B
Python
30 lines
703 B
Python
from flask import Blueprint
|
|
from flask_restx import Namespace
|
|
|
|
from libs.external_api import ExternalApi
|
|
|
|
bp = Blueprint("openapi", __name__, url_prefix="/openapi/v1")
|
|
|
|
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 index
|
|
from .oauth_device import code as oauth_device_code
|
|
from .oauth_device import lookup as oauth_device_lookup
|
|
from .oauth_device import token as oauth_device_token
|
|
|
|
__all__ = [
|
|
"index",
|
|
"oauth_device_code",
|
|
"oauth_device_lookup",
|
|
"oauth_device_token",
|
|
]
|
|
|
|
api.add_namespace(openapi_ns)
|