LifeMate — Personal, Family & Learning Companion

feat/aparat-learning-library
chore/phase1-repository-cleanup deploy/stable-web-apk deployment-static design/mobile-accessibility-v2 design/mobile-navigation-review docs/child-education-access-decision docs/offline-data-rescue-options docs/owner-guide-and-delivery-plan docs/phase1-policy-options docs/public-review-live-2026-10-15 feat/aparat-learning-library feat/child-device-safety feat/child-identity-schema feat/flutter-mobile-navigation feat/learning-content-operations feat/local-signing-preflight feat/online-family-stage0 feat/personal-encrypted-recovery feat/private-planner-series-api feat/public-review-page feat/standalone-weekly-planner feat/weekly-planner-android final-feature-1/iran-family-school fix/auth-abuse-expiry-safety fix/auth-expiry-after-lock fix/backend-request-safety fix/lifeguide-bootstrap-naming-ci fix/lifeguide-pages-qa-base-preflight fix/lifeguide-qa-pages-env-deployment fix/local-task-persistence fix/managed-child-session-boundary fix/personal-jalali-dates fix/personal-notification-controls fix/personal-upgrade-delivery-guard fix/sms-approval-gates fix/study-duration-display infra/cloudflare-neon-migration infra/lifeguide-cloudflare-qa infra/lifeguide-github-pages-qa infra/lifeguide-supabase-qa main phase-1/foundation-completion phase-2/product-foundation-identity phase-3/planner-school-family-core phase-4/ai-learning-wellbeing phase-5/hardening-observability-release test/android-reminder-acceptance test/personal-notification-settings test/personal-recovery-acceptance test/role-entry-apk
py 18 lines 990 Bytes
Raw
1 #!/usr/bin/env python3
2 """Check tracked files only; synthetic fixture literals are not live secrets."""
3 import re
4 import subprocess
5 from pathlib import Path
6
7 files = subprocess.check_output(['git', 'ls-files', '-z']).decode().split('\0')
8 patterns = re.compile(rb'-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----|AKIA[0-9A-Z]{16}|gh[pousr]_[A-Za-z0-9_]{30,}|sk_live_[A-Za-z0-9]{20,}')
9 errors = []
10 for name in filter(None, files):
11 p = Path(name)
12 if not p.is_file(): continue
13 if (p.name.startswith('.env') and p.name != '.env.example') or p.suffix.lower() in {'.jks', '.keystore', '.dump', '.p12', '.pfx'}:
14 errors.append(f'{name}: private artifact must not be tracked')
15 if p.stat().st_size > 10_000_000: continue
16 if patterns.search(p.read_bytes()): errors.append(f'{name}: high-confidence secret pattern (content withheld)')
17 if errors: raise SystemExit('\n'.join(errors))
18 print('Tracked-file credential/artifact scan passed; this is not a complete secret audit.')