dify/api/controllers
GareArc 71e9e8dda6
feat(api): lift SSO branch device-flow handlers to /openapi/v1 (Phase D.15-16)
The four EE-only SSO handlers (sso_initiate, sso_complete,
approval_context, approve_external) move from controllers/oauth_device_sso.py
to controllers/openapi/oauth_device/. Each is registered on openapi_bp
via @bp.route at the canonical path:

  /openapi/v1/oauth/device/sso-initiate
  /openapi/v1/oauth/device/sso-complete
  /openapi/v1/oauth/device/approval-context
  /openapi/v1/oauth/device/approve-external

sso-complete moves under /oauth/device/ from its previous orphan path
/v1/device/sso-complete; the IdP-side ACS callback URL hardcoded in
sso_initiate now points to the canonical path. Operators must
re-register the ACS callback with each IdP before Phase F deletes the
legacy alias.

oauth_device_sso.py shrinks to a thin re-mount file: same legacy bp
with attach_anti_framing applied, four bp.add_url_rule() calls binding
the legacy paths to the imported view functions. Same handler runs
for both mounts — no duplicated logic.

attach_anti_framing(openapi_bp) added in controllers/openapi/__init__.py
so X-Frame-Options + frame-ancestors CSP cover the canonical paths too.

Plan: docs/superpowers/plans/2026-04-26-openapi-migration.md (in difyctl repo).
2026-04-27 00:00:24 -07:00
..
common chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00
console feat(api): lift device-flow approve/deny to /openapi/v1 (Phase D.13-14) 2026-04-26 23:57:28 -07:00
files refactor(api): continue decoupling dify_graph from API concerns (#33580) 2026-03-25 20:32:24 +08:00
inner_api fix: scope plugin inner API end-user lookup by tenant (#35325) 2026-04-17 06:12:07 +00:00
mcp chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00
openapi feat(api): lift SSO branch device-flow handlers to /openapi/v1 (Phase D.15-16) 2026-04-27 00:00:24 -07:00
service_api feat(api): lift identity + self-revoke to /openapi/v1/account (Phase C.9-10) 2026-04-26 23:50:15 -07:00
trigger refactor(api): type webhook data extraction with RawWebhookDataDict TypedDict (#34486) 2026-04-03 02:24:17 +00:00
web chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00
__init__.py chore(api/controllers): Apply Ruff Formatter. (#7645) 2024-08-26 15:29:10 +08:00
fastopenapi.py feat: init fastopenapi (#30453) 2026-01-23 21:07:52 +09:00
oauth_device_sso.py feat(api): lift SSO branch device-flow handlers to /openapi/v1 (Phase D.15-16) 2026-04-27 00:00:24 -07:00