诚实性修复: API限流Retry-After(wait=60s)+断言 / purge定时接线(04:00 cron+actor+测试) / Channel表单校验(ref+rules+validate) / README PG数字513

This commit is contained in:
seagull
2026-09-12 02:20:50 +08:00
parent b3f3095d53
commit 67540e8d30
40 changed files with 1805 additions and 31 deletions
+4
View File
@@ -52,6 +52,10 @@ class APIKeyViewSet(BaseTenantViewSet):
expires_at=data.get("expires_at"),
created_by=user,
)
# P0-5:允许创建时指定 rate_limit(下界 1 由 serializer 保证)。
if data.get("rate_limit") is not None:
key_obj.rate_limit = data["rate_limit"]
await sync_to_async(key_obj.save)(update_fields=["rate_limit"])
res_data = APIKeySerializer(key_obj).data
res_data["raw_key"] = raw_key # 仅在创建时返回一次明文密钥!