Tighten location request validation

This commit is contained in:
2026-04-19 23:18:20 +02:00
parent 1a2f9c75d9
commit d0dc8e893a
5 changed files with 132 additions and 15 deletions
+7
View File
@@ -2,6 +2,13 @@
本文档说明 `location recorder` 在 Python 项目中的当前数据库接管策略,以及 legacy SQLite 接管 runbook。
当前 Python 版本的 `POST /location/record` 请求校验策略是:
- `latitude``longitude` 为必填,缺失或无法解析成合法数值时返回 `400 bad request`
- `altitude` 为可选,缺失或非法时按 `0` 处理
- unknown field 仍返回 `400 bad request`
- 对 caller 的错误响应保持简洁,不直接暴露底层校验细节;详细原因只写日志
## Legacy 事实基线
当前 legacy SQLite 中 `location` 表的真实 schema 为: