mirror of
https://github.com/langgenius/dify.git
synced 2026-05-20 16:57:01 +08:00
Four per-app GETs (/apps/<id>, /info, /parameters, /describe) repeated the same SSO-guard / app-load / membership-check pattern. Hoist into _AppReadResource with method_decorators=[require_scope, validate_bearer] plus _load(app_id) -> (App, AuthContext). Subclasses now 3-line bodies. Eliminates the per-method # type: ignore[reportUntypedFunctionDecorator] suppression by relocating the decorator chain to the class attribute. Endpoints now build typed AppInfoResponse / AppDescribeResponse and .model_dump() at the boundary.