dify/api/controllers/console
GareArc 772f450b29
feat(api): lift device-flow approve/deny to /openapi/v1 (Phase D.13-14)
DeviceApproveApi + DeviceDenyApi (cookie-authed) move to
controllers/openapi/oauth_device/{approve,deny}.py. Decorator stack
preserved verbatim: setup_required → login_required →
account_initialization_required → bearer_feature_required →
rate_limit. Audit event names ('oauth.device_flow_approved' /
'oauth.device_flow_denied') unchanged so the OTel exporter
registration keeps routing them.

The legacy /console/api/oauth/device/{approve,deny} mounts are
re-registered on console_ns from the bottom of the new files via a
local-import _register_legacy_console_mount() helper. The local
import breaks an import cycle that would otherwise form: openapi
imports console.wraps for setup_required, console.__init__.py imports
console.auth.oauth_device, which would re-import the openapi class
mid-load. Deferring console_ns past the class definition resolves it.

console/auth/oauth_device.py becomes a 9-line placeholder (the
existing console.__init__.py `from .auth import (..., oauth_device,
...)` keeps loading until Phase F prunes the import).

Plan: docs/superpowers/plans/2026-04-26-openapi-migration.md (in difyctl repo).
2026-04-26 23:57:28 -07:00
..
app fix: accept icon type in app icon updates (#35360) 2026-04-20 02:33:49 +00:00
auth feat(api): lift device-flow approve/deny to /openapi/v1 (Phase D.13-14) 2026-04-26 23:57:28 -07:00
billing refactor: replace inline api.model with register_schema_models in billing (#34928) 2026-04-11 04:01:03 +00:00
datasets fix: prevent double /v1 in MCP server URL causing 404 authorization failure (#34596) 2026-04-20 02:42:59 +00:00
explore chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00
socketio feat: collaboration (#30781) 2026-04-16 02:21:04 +00:00
tag refactor(api): migrate console tag responses from marshal_with to BaseModel (#35208) 2026-04-15 09:57:27 +00:00
workspace fix: prevent double /v1 in MCP server URL causing 404 authorization failure (#34596) 2026-04-20 02:42:59 +00:00
__init__.py feat(api,web): OAuth 2.0 device flow + bearer auth (RFC 8628) 2026-04-26 20:06:43 -07:00
admin.py refactor(api): migrate dict returns to TypedDicts in billing service (#34649) 2026-04-07 05:56:02 +00:00
apikey.py refactor: migrate apikey from marshal_with/api.model to Pydantic BaseModel (#34932) 2026-04-13 05:18:42 +00:00
error.py Restructure the File errors in controller (#23801) 2025-08-13 17:06:07 +08:00
extension.py refactor(api): migrate console extension endpoint from api.model to BaseModel (#35189) 2026-04-14 17:58:33 +00:00
feature.py fix: revert "refactor: api/controllers/console/feature.py (test)" (#31850) 2026-02-03 12:26:47 +08:00
files.py refactor: port api/fields/file_fields.py (#30638) 2026-01-06 22:55:58 +08:00
human_input_form.py refactor: migrate console human_input_form from reqparse to PydanticBaseModel (#34858) 2026-04-09 15:38:47 +00:00
init_validate.py refactor: init_validate.py to v3 (#31457) 2026-01-30 22:39:02 +09:00
notification.py refactor: replace bare dict with typed annotations in controllers (#35095) 2026-04-13 19:19:52 +00:00
ping.py feat: init fastopenapi (#30453) 2026-01-23 21:07:52 +09:00
remote_files.py chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00
setup.py refactor: select in console auth, setup and apikey (#33790) 2026-03-21 11:29:29 +09:00
spec.py refactor(router): apply ns.route style (#26339) 2025-09-28 13:37:06 +08:00
version.py refactor: api/controllers/console/version.py to v3 (#31463) 2026-01-26 15:04:25 +08:00
wraps.py refactor: replace bare dict with UtmInfo TypedDict in operation_service (#35055) 2026-04-13 13:05:47 +00:00