Harden scans and add LOC comparison endpoint #1

Merged
luna merged 2 commits from harden-loc-service into main 2026-07-21 19:33:08 +02:00
Collaborator

What changed:

  • Restrict Git clones to the ALLOWED_GIT_HOSTS allowlist and reject local, unsupported, and credential-bearing URLs.
  • Add file-count, per-file, total scan-size, temporary filesystem, and non-interactive Git limits.
  • Return the resolved commit SHA and avoid using SSH keys for ordinary HTTPS clones.
  • Skip common generated/minified files and build/vendor directories; expand language detection.
  • Add GET /loc/diff for base/head totals and per-language deltas.

Verified: 7 passing npm tests, Docker Compose config/build, and a real HTTPS scan against octocat/Hello-World.

What changed: - Restrict Git clones to the ALLOWED_GIT_HOSTS allowlist and reject local, unsupported, and credential-bearing URLs. - Add file-count, per-file, total scan-size, temporary filesystem, and non-interactive Git limits. - Return the resolved commit SHA and avoid using SSH keys for ordinary HTTPS clones. - Skip common generated/minified files and build/vendor directories; expand language detection. - Add GET /loc/diff for base/head totals and per-language deltas. Verified: 7 passing npm tests, Docker Compose config/build, and a real HTTPS scan against octocat/Hello-World.
luna added 1 commit 2026-07-21 19:28:27 +02:00
Harden repository scans and add LOC comparisons
ci / test (pull_request) Successful in 15s
cd84c68a3e
luna added 1 commit 2026-07-21 19:30:44 +02:00
Allow all Git hosts when allowlist is unset
ci / test (pull_request) Successful in 18s
b77e4c619d
luna merged commit 91c0ed7332 into main 2026-07-21 19:33:08 +02:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: space/loc-via-git#1