重组为 backend/clients/docs 三层结构,并清理 git 污染。
将后端迁入 backend/,完善根目录 .gitignore,删除误提交的 .mypy_cache 缓存文件。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
14
backend/app/services/video/rtsp_redact.py
Normal file
14
backend/app/services/video/rtsp_redact.py
Normal file
@@ -0,0 +1,14 @@
|
||||
"""RTSP URL 日志脱敏。"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
|
||||
_RTSP_CRED_RE = re.compile(r"(?P<scheme>rtsp://)(?P<userinfo>[^@/\s]+@)")
|
||||
|
||||
|
||||
def redact_rtsp_url(url: str | None) -> str:
|
||||
"""把 ``rtsp://user:pwd@host/...`` 脱敏为 ``rtsp://***@host/...``。"""
|
||||
if not url:
|
||||
return ""
|
||||
return _RTSP_CRED_RE.sub(r"\g<scheme>***@", url)
|
||||
Reference in New Issue
Block a user