修复(#3): 抽奖 Stage 1 后台审计 IP/UA 丢失 + 冒烟脚本 Bearer 前缀
Closes HIF-3 (Stage 1 P1 defects from QA smoke report) F2: admin_action_log.ip / user_agent 恒为空 - 根因:requestMeta 从 ctx 读裸字符串 key,全库无 writer 塞 - 修复:新增 AdminMetaMiddleware 用 typed constant.CtxKeyIP / CtxKeyUserAgent - 挂载:lottery admin 组末尾(不 gate access) - 回归护栏:UsesTypedKey + IgnoresBareStringKeys 双向断言 typed key,防止未来退化回裸字符串 F3: qa/lottery/stage1_curl.sh Bearer 前缀 - 删除两处 Bearer 前缀 + 加注释说明 ppanel AuthMiddleware 不 strip 单测 5 用例全绿;scope 严格限于 lottery admin 组,其它路径零改动;无 DB 变更。 Merged: architect review 后,将触发 staging 二次部署 — 期望这次能一并解决 shanshanzhong147 手工 SSH 后 Lottery.Enable=true 未生效的问题(若真是 mount/restart 未正确 pick up)。
This commit is contained in:
@@ -19,8 +19,10 @@ ADMIN_TOKEN="${ADMIN_TOKEN:-CHANGE_ME}"
|
||||
USER_TOKEN="${USER_TOKEN:-CHANGE_ME}"
|
||||
USER_ID="${USER_ID:-1}"
|
||||
|
||||
hdr_admin=(-H "Authorization: Bearer ${ADMIN_TOKEN}" -H "Content-Type: application/json")
|
||||
hdr_user=(-H "Authorization: Bearer ${USER_TOKEN}" -H "Content-Type: application/json")
|
||||
# ppanel AuthMiddleware 不 strip Bearer 前缀,直接把整个 Authorization header 传给
|
||||
# jwt.ParseJwtToken —— 所以这里必须传裸 JWT,不能加 "Bearer " 前缀,否则 parse fail → 40004。
|
||||
hdr_admin=(-H "Authorization: ${ADMIN_TOKEN}" -H "Content-Type: application/json")
|
||||
hdr_user=(-H "Authorization: ${USER_TOKEN}" -H "Content-Type: application/json")
|
||||
|
||||
log() {
|
||||
printf '\n\033[1;34m▶ %s\033[0m\n' "$*"
|
||||
|
||||
Reference in New Issue
Block a user