mirror of
https://github.com/langgenius/dify.git
synced 2026-05-20 16:57:01 +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).
21 lines
1.0 KiB
Python
21 lines
1.0 KiB
Python
"""Legacy /v1/* mounts for the OAuth bearer + device-flow endpoints.
|
|
Canonical handlers live in controllers/openapi/. This file just
|
|
re-registers them on the service_api_ns until Phase F retires the
|
|
legacy paths entirely.
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
from controllers.openapi.account import AccountApi, AccountSessionsSelfApi
|
|
from controllers.openapi.oauth_device.code import OAuthDeviceCodeApi
|
|
from controllers.openapi.oauth_device.lookup import OAuthDeviceLookupApi
|
|
from controllers.openapi.oauth_device.token import OAuthDeviceTokenApi
|
|
from controllers.service_api import service_api_ns
|
|
|
|
# Legacy /v1/* mounts — handlers live in controllers/openapi/.
|
|
# Removed in Phase F.
|
|
service_api_ns.add_resource(OAuthDeviceCodeApi, "/oauth/device/code")
|
|
service_api_ns.add_resource(OAuthDeviceTokenApi, "/oauth/device/token")
|
|
service_api_ns.add_resource(OAuthDeviceLookupApi, "/oauth/device/lookup")
|
|
service_api_ns.add_resource(AccountApi, "/me")
|
|
service_api_ns.add_resource(AccountSessionsSelfApi, "/oauth/authorizations/self")
|