dify/api/tests/unit_tests/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 test: unit test case for controllers.common module (#32056) 2026-03-09 09:45:42 +08:00
console fix: prevent double /v1 in MCP server URL causing 404 authorization failure (#34596) 2026-04-20 02:42:59 +00: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
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 chore(api): adapt Graphon 0.2.2 upgrade (#35377) 2026-04-18 11:16:24 +00:00
trigger fix: clarify webhook debug endpoint behavior (#33597) 2026-03-18 14:28:33 +08:00
web chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00
__init__.py feat: return data_source_info and data_source_detail_dict (#29912) 2026-01-05 11:04:03 +08:00
test_compare_versions.py refactor(version): simplify version comparison logic (#10109) 2024-10-31 15:15:32 +08:00
test_conversation_rename_payload.py fix: conversation rename payload validation (#29510) 2025-12-11 18:05:41 +09:00