Skip to content

fix: strip credentials from git remote URLs in comfy node init#376

Merged
bigcat88 merged 1 commit intomainfrom
fix/strip-credentials-from-git-remote-url
Mar 13, 2026
Merged

fix: strip credentials from git remote URLs in comfy node init#376
bigcat88 merged 1 commit intomainfrom
fix/strip-credentials-from-git-remote-url

Conversation

@bigcat88
Copy link
Contributor

When a user has a personal access token or other credentials embedded in their git remote URL (e.g. https://token@github.com/user/repo.git), comfy node init writes that token into the generated pyproject.toml under Repository, Documentation, and Bug Tracker URLs. This is a security issue since the token can end up committed and pushed publicly.

This adds a small helper that strips credentials from the URL right after retrieving it from git, before it gets written anywhere. SSH URLs and clean HTTPS URLs pass through unchanged.

Fixes #342

@codecov
Copy link

codecov bot commented Mar 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff             @@
##             main     #376      +/-   ##
==========================================
+ Coverage   60.49%   62.47%   +1.98%     
==========================================
  Files          33       33              
  Lines        3678     3683       +5     
==========================================
+ Hits         2225     2301      +76     
+ Misses       1453     1382      -71     
Files with missing lines Coverage Δ
comfy_cli/registry/config_parser.py 93.54% <100.00%> (+43.54%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bigcat88 bigcat88 force-pushed the fix/strip-credentials-from-git-remote-url branch from eddd06f to a206c97 Compare March 13, 2026 14:41
@bigcat88 bigcat88 marked this pull request as ready for review March 13, 2026 15:00
@dosubot dosubot bot added the bug Something isn't working label Mar 13, 2026
@bigcat88 bigcat88 merged commit 50e2fab into main Mar 13, 2026
14 checks passed
@bigcat88 bigcat88 deleted the fix/strip-credentials-from-git-remote-url branch March 13, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automatically erase github personal access token from url

1 participant