#!/usr/bin/env python3 import re EXCLUDE_PATH_PARTS = {'Infrastructure', 'Home-Automation', '00_Inbox', '04_Archive'} EXCLUDE_DIR_NAMES = {'.git', '.obsidian', '.claude', '.venv-memory', '.memory', '.chroma_data'} EXCLUDE_FILENAME_KEYWORDS = ['password', 'secret', 'credential', 'token', 'apikey', '.env'] SENSITIVE_LITERAL_MARKERS = [ '-----begin', 'authorization: bearer ', 'x-api-key:', 'private key', 'aws_access_key_id', 'password:', 'passwd:', '账号:', '账号:', '用户名:', '用户名:', '密码:', '密码:', ] SENSITIVE_REGEX_PATTERNS = [ re.compile(r'-----BEGIN [A-Z ]*PRIVATE KEY-----'), re.compile(r'AKIA[0-9A-Z]{16}'), re.compile(r'ASIA[0-9A-Z]{16}'), re.compile(r'ghp_[A-Za-z0-9]{36}'), re.compile(r'eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}'), re.compile(r'(?i)\b(password|passwd|pwd|token|secret|api[_-]?key)\b\s*[:=]\s*\S{4,}'), re.compile(r'(账号|用户名|密码)\s*[::]\s*\S{2,}'), ]