feat: 采集接口(域名白名单/限流/textplain解析/幂等)

POST /api/collect/batch:text/plain JSON 解析(ParseError 400 防 500)、
域名白名单/站点停用/未知站点统一 403 not_allowed 防枚举、
Anon 限流(collect scope,get_rate 读实时 api_settings 修 import 固化)、
occurred_at ISO 归一(naive 补 UTC)、XFF 末段取 IP + ::ffff: 归一、
成功/拒绝分支均回显 ACAO 供 SDK 读响应。

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-09-15 13:07:56 +08:00
parent acb180e363
commit cf04db794b
4 changed files with 170 additions and 1 deletions
+6 -1
View File
@@ -1 +1,6 @@
urlpatterns = [] # Task 7 起逐任务填充
from django.urls import path
from tracker.api.collect import CollectBatchView
urlpatterns = [
path("api/collect/batch", CollectBatchView.as_view()),
]