Add API security and async job contracts

This commit is contained in:
732642856
2026-07-16 23:40:01 +08:00
parent a7fdfcb033
commit e013fed79c
10 changed files with 573 additions and 17 deletions
+8
View File
@@ -29,6 +29,7 @@ import sys
import re
import glob
import argparse
from urllib.parse import urlparse
try:
import markdown
@@ -323,6 +324,13 @@ def build_cover(name, lagna, gender, status, pkg, desc, lang="cn"):
</div>"""
def is_allowed_report_resource_url(url, *, report_url):
if url == report_url:
return True
parsed = urlparse(url)
return parsed.scheme in {'data', 'about', 'blob'}
def build_toc(sections, lang="cn"):
"""Generate table of contents HTML."""
toc_title = "目录" if lang == "cn" else "Table of Contents"