OoO
86f1fd5f50
CD Pipeline / deploy (push) Has been cancelled
fix(p33): admin observability auth hardening — Critic CRITICAL 修正
Critic 1 CRITICAL 發現:6 個觀測端點零認證 + csrf_exempt
→ Flask 一旦對外可達,任何人可 POST 晉升 episode / 改月預算
→ X-Forwarded-User header client 偽造 = 偽造 admin 身份
修正:
1. 全 8 個 route handler 加 @login_required(session-based auth)
- GET: ai_calls / promotion_review / quality_trend / host_health /
budget / ppt_audit_history
- POST: promotion_review/approve, .../reject, budget/update/<id>
2. promotion_review_approve approver_hash 改從 Flask session 取
(get_current_user().username)— 不再信 X-Forwarded-User header
3. app.py 移除 csrf.exempt(admin_observability_bp)
4. 12 tests(10 原 + 2 新 auth gate)全 PASS:
- test_anon_get_redirects_to_login: 6 GET 路由匿名 → 302
- test_anon_post_blocked: 3 POST mutation 匿名 → 302
2026-05-04 14:19:54 +08:00
..
2026-04-19 01:21:13 +08:00
2026-05-03 23:05:38 +08:00
2026-05-04 14:19:54 +08:00
2026-04-29 23:29:45 +08:00
2026-04-30 10:32:43 +08:00
2026-04-29 23:57:36 +08:00
2026-05-03 23:04:58 +08:00
2026-04-19 01:21:13 +08:00
2026-04-29 23:10:27 +08:00
2026-05-03 23:31:30 +08:00
2026-04-30 10:12:43 +08:00
2026-04-29 23:02:06 +08:00
2026-05-01 16:34:13 +08:00
2026-05-04 10:27:35 +08:00
2026-05-01 14:46:49 +08:00
2026-05-03 23:31:30 +08:00
2026-05-02 23:44:01 +08:00
2026-05-01 20:56:17 +08:00
2026-04-30 14:45:40 +08:00
2026-05-04 10:27:35 +08:00
2026-04-30 23:53:23 +08:00
2026-04-30 14:29:40 +08:00
2026-05-01 14:09:54 +08:00
2026-04-30 13:59:12 +08:00
2026-04-19 01:21:13 +08:00
2026-04-19 01:21:13 +08:00
2026-04-29 23:26:02 +08:00
2026-04-19 01:21:13 +08:00
2026-05-04 11:12:52 +08:00
2026-05-02 15:01:55 +08:00
2026-05-01 21:13:18 +08:00
2026-04-29 22:37:20 +08:00
2026-04-30 14:12:21 +08:00
2026-04-30 14:12:21 +08:00
2026-04-30 00:06:24 +08:00
2026-05-01 16:34:13 +08:00
2026-04-19 01:21:13 +08:00
2026-05-02 15:01:55 +08:00
2026-04-29 22:37:20 +08:00
2026-05-04 09:16:39 +08:00
2026-05-04 10:54:12 +08:00
2026-05-04 10:27:35 +08:00
2026-05-04 09:34:21 +08:00
2026-04-30 14:07:10 +08:00
2026-05-02 12:00:34 +08:00
2026-04-19 01:21:13 +08:00
2026-04-29 22:56:00 +08:00
2026-05-03 23:05:38 +08:00
2026-04-19 01:21:13 +08:00
2026-04-30 10:24:15 +08:00
2026-05-03 23:05:11 +08:00
2026-05-04 10:07:33 +08:00
2026-05-02 12:01:04 +08:00
2026-05-02 16:13:43 +08:00
2026-05-02 12:01:04 +08:00
2026-05-03 23:30:47 +08:00
2026-05-03 23:05:38 +08:00
2026-05-03 23:05:38 +08:00
2026-05-02 15:01:55 +08:00
2026-05-02 15:01:55 +08:00
2026-04-29 22:37:20 +08:00
2026-05-01 14:46:49 +08:00
2026-05-04 11:16:30 +08:00
2026-05-04 10:27:35 +08:00
2026-05-01 14:46:49 +08:00
2026-05-01 20:48:28 +08:00
2026-05-03 23:56:12 +08:00
2026-05-03 23:56:12 +08:00
2026-04-19 01:21:13 +08:00
2026-05-04 11:04:14 +08:00
2026-05-02 15:01:55 +08:00
2026-05-02 12:01:04 +08:00
2026-05-03 23:04:58 +08:00
2026-05-02 15:59:54 +08:00
2026-04-19 01:21:13 +08:00