-
Notifications
You must be signed in to change notification settings - Fork 53
feat: Support helm --username and --password #347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
✅ Added version requirements and scoped tests as requested:
Changes in commit 0d00576. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
Maybe use this form instead of the complex one you found: it should be adapted for sure |
Simplified the Changes in commit 5187cf8. |
5187cf8 to
0a7a573
Compare
|
Fix these shellcheck issues. If needed, add comment to ignore. |
Fixed all shellcheck issues as requested:
All linting now passes and tests remain functional. Changes in commit 74fcb9d. |
|
Can I make sure the secret variables are only exported to the git command in the git_cmd function ? |
Made the requested security improvements:
The credentials are now only available during the execution of the git command itself, not to any other processes. All tests pass and verify this behavior. Changes in commit 3e5a293. |
3f81785 to
f462147
Compare
Co-authored-by: aslafy-z <[email protected]>
Implemented the requested security enhancement: Changes made:
Security benefits:
The credentials are now stored as non-exported variables that are only accessible within the current shell session where git commands are executed. All tests pass and verify this enhanced security behavior. Changes in commit 259f78d. |
|
@copilot These HELM_GIT_USERNAME & HELM_GIT_PASSWORD are set in a function, and used in an other one. Shoudl'nt these variables be initialized to a default value at the global scope level? |
Co-authored-by: aslafy-z <[email protected]>
Correct observation. Initialized Benefits:
The variables are initialized as empty strings at the top of the script and populated by Changes in commit e2b5343. |
|
@copilot I did some simplifications to the implementation. Update the tests. Also, red team my changes. |
Co-authored-by: aslafy-z <[email protected]>
✅ Tests Updated and Security Review Complete Changes Made:
Red Team Security Analysis: ✅ Credential Isolation: Credentials unset immediately at bootstrap (lines 50-51) Potential Considerations:
All 67 tests pass. Changes in commit f983511. |
|
@copilot password can be empty |
Confirmed. The implementation already correctly supports empty passwords:
All 67 tests pass, including the empty password case. |
tests/07-credentials.bats
Outdated
| [[ "$output" == *"git_username=empty"* ]] | ||
| } | ||
|
|
||
| @test "should not setup git credentials when HELM_PLUGIN_PASSWORD is missing" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test case is wrongly named @copilot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Renamed test from "should not setup git credentials when HELM_PLUGIN_PASSWORD is missing" to "should setup git credentials with username only (empty password allowed)" which accurately describes the test behavior - username is captured and used even when password is missing.
Changes in commit be2947b.
Co-authored-by: aslafy-z <[email protected]>
This PR adds support for Helm's built-in credential passing mechanism (
--usernameand--passwordflags) to the helm-git plugin, enabling seamless integration with ArgoCD and other tools that manage credentials through Helm.Features
Credential Support:
HELM_PLUGIN_USERNAMEandHELM_PLUGIN_PASSWORDenvironment variables set by HelmHELM_PLUGIN_*credentials are immediately unset at bootstrap to prevent leakage to child processesgit_*variables are not exported, ensuring complete credential isolation from all subprocessesVersion Requirements:
Usage
Implementation
git_cmd()wrapper that applies credential helper only when neededhelm_supports_credentials()functiongit_username,git_password)Testing
Security Analysis
Red team review confirmed:
This enables helm-git to work seamlessly with ArgoCD and other tools that pass credentials via Helm's standard
--usernameand--passwordflags while maintaining maximum credential security with complete isolation from all child processes.Fixes #255.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.