fix: strip credentials from git remote URLs in comfy node init#376
Merged
fix: strip credentials from git remote URLs in comfy node init#376
Conversation
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
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
eddd06f to
a206c97
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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