mirror of
https://github.com/langgenius/dify.git
synced 2026-05-09 12:59:18 +08:00
Same pattern as B.6: OAuthDeviceTokenApi moves to controllers/openapi/oauth_device/token.py and is re-registered on service_api_ns to keep /v1/oauth/device/token serving until Phase F. _audit_cross_ip_if_needed helper moves with the handler. Now-unused imports removed from service_api/oauth.py. Plan: docs/superpowers/plans/2026-04-26-openapi-migration.md (in difyctl repo).
28 lines
620 B
Python
28 lines
620 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 token as oauth_device_token
|
|
|
|
__all__ = [
|
|
"index",
|
|
"oauth_device_code",
|
|
"oauth_device_token",
|
|
]
|
|
|
|
api.add_namespace(openapi_ns)
|