sync update from LAN repo (source dhk-1 @ 3b1ec5b4)

This commit is contained in:
gozeros committed 2026-11-05 10:56:34 +08:00
1 parent da6521b6cb
commit 264e2200d6
995 files changed
+148105 -13399

No files matched your search

@@ -0,0 +1,14 @@
"""Credential assurance required by both Gateway and LangGraph sessions."""
from app.gateway.auth.jwt import TokenPayload
from deerflow.config.system_settings import load_system_settings
def session_policy_error(payload: TokenPayload) -> str | None:
"""Return a rejection reason for a signed but no longer permitted session."""
policy = load_system_settings().authentication
if payload.auth_method == "sso" and not policy.sso_enabled:
return "外部系统免登已关闭,请使用账号密码重新登录"
if policy.password_login_enabled and payload.auth_method not in {"password", "passphrase", "sso"}:
return "已开启登录验证,请重新登录"
return None