mirror of
https://github.com/langgenius/dify.git
synced 2026-05-20 08:46:57 +08:00
GET /v1/me moves to GET /openapi/v1/account. DELETE /v1/oauth/authorizations/self moves to DELETE /openapi/v1/account/sessions/self. Both classes (AccountApi, AccountSessionsSelfApi) are now in controllers/openapi/account.py and re-registered on service_api_ns at the legacy paths. service_api/oauth.py is now nothing but legacy re-mount declarations (20 lines). All in-place handler logic has moved to openapi/. Phase F will delete the file and the legacy mounts together. Helper functions (_load_memberships, _pick_default_workspace, _workspace_payload, _account_payload) move with the AccountApi class. Plan: docs/superpowers/plans/2026-04-26-openapi-migration.md (in difyctl repo).
31 lines
727 B
Python
31 lines
727 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 account, 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__ = [
|
|
"account",
|
|
"index",
|
|
"oauth_device_code",
|
|
"oauth_device_lookup",
|
|
"oauth_device_token",
|
|
]
|
|
|
|
api.add_namespace(openapi_ns)
|