Align backend authentication and API response contracts

Replace cookie authentication with revocable Bearer sessions, optional one-use PNG challenges, bounded login limits, and short-lived market WebSocket tickets. Keep captcha disabled by default.

Standardize ordinary JSON responses while preserving HTTP statuses, raw OpenAPI, redirects, SSE, and WebSocket semantics. Revoke long connections with their owning session.

Expose official calendar data and collector status to the frontend and research tools, support bilingual news topics, and keep summaries and forward-only labels explicit. Verify the staged snapshot with all 305 backend tests.
This commit is contained in:
eezd committed 2026-10-26 12:04:21 +08:00
1 parent b9d7497a7d
commit f67a8ca402
24 files changed
+1731 -212

No files matched your search

+2
View File
@@ -6,5 +6,7 @@ JWT_SECRET=<openssl rand -hex 32>
ADMIN_USERNAME=admin
# 哈希含 $,必须用单引号包住,否则 compose 会做变量替换
ADMIN_PASSWORD_HASH='<python -m alphapulse.core.auth hash-password 的输出>'
# 登录验证码默认关闭;设为 true 后启用,修改后须重新部署 API
LOGIN_CAPTCHA_ENABLED=false
# 加密存库的第三方 API key(Fernet);丢失后已存的 key 无法解密,需要在页面重新填写
SECRET_ENCRYPTION_KEY=<python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())">