Move HF_TOKEN to libgit2 lib - #4530
Open
rasapala wants to merge 2 commits into
Open
Conversation
rasapala
requested review from
dtrawins and
mzegla
and
a lite review from Copilot
September 9, 2026 13:27
mzegla
reviewed
Sep 9, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A new/updated logging path still prints default environment values despite the stated intent to avoid logging env values, which is a security-hardening inconsistency.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR adjusts Hugging Face model pulling to avoid embedding HF_TOKEN in repository URLs, instead relying on libgit2/LFS integration to apply authentication, and removes overly-verbose debug logging of environment variable values.
Changes:
- Removed
hfTokenplumbed throughHfDownloaderand stopped constructing credential-in-URL repo strings. - Added
HF_TOKEN-based auth configuration in the libgit2 LFS curl path (via the vendoredlfs.patch). - Reduced debug logging to avoid printing environment variable values.
File summaries
| File | Description |
|---|---|
| third_party/libgit2/lfs.patch | Adds curl auth configuration for LFS requests based on HF_TOKEN. |
| src/test/pull_hf_model_test.cpp | Updates unit tests to reflect token no longer being embedded in repo URLs. |
| src/pull_module/libgit2.hpp | Updates HfDownloader API by removing the hfToken constructor parameter/member. |
| src/pull_module/libgit2.cpp | Removes URL-embedded-credentials logic and clones using the plain repo URL. |
| src/pull_module/hf_pull_model_module.cpp | Avoids logging environment variable values and updates HfDownloader construction accordingly. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
mzegla
reviewed
Sep 9, 2026
Co-authored-by: Miłosz Żeglarski <milosz.zeglarski@intel.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
🛠 Summary
JIRA CVS-194439, CVS-194440
Remove debug logs and move token setting to libgit2 library.
🧪 Checklist
``