Open
Conversation
Add UseAgent, AgentSocket, and NoSudo options to SSHConfig. When UseAgent is true, authentication uses the SSH agent (SSH_AUTH_SOCK) instead of a private key. NoSudo skips the sudo prefix when the SSH user can run midclt directly. Closes #5 Based on work by Dalton Perdue in deevus/terraform-provider-truenas#5. Co-Authored-By: Dalton Perdue <dalton@perdue.io> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
⬇️ Go test coverage decreased from 86.4% to 86.3% compared to c25763d
Updated Package Coverages: # Package Name | Prior | New
- github.com/deevus/truenas-go/client | 88.9% | 88.8%View coverage for all packages# Package Name | Coverage
+ github.com/deevus/truenas-go | 83.2%
+ github.com/deevus/truenas-go/api | 87.5%
+ github.com/deevus/truenas-go/client | 88.8%
+ github.com/deevus/truenas-go/cmd/featurematrix | 92.9% |
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
UseAgentandAgentSocketfields toSSHConfigfor SSH agent authentication as an alternative to private key authNoSudofield to skip thesudoprefix when the SSH user can runmidcltdirectlySSH_AUTH_SOCKenv varUseAgentandPrivateKeyare mutually exclusive (validated)Based on work by @f33rx in deevus/terraform-provider-truenas#5.
Closes #5
Test plan
TestSSHConfig_Validate_AgentMode— valid agent config with explicit socketTestSSHConfig_Validate_AgentAndPrivateKeyMutuallyExclusive— rejects both setTestSSHConfig_Validate_AgentWithEnvSocket— falls back to SSH_AUTH_SOCKTestSSHConfig_Validate_AgentNoSocketAvailable— errors with no socketTestSSHConfig_Validate_PrivateKeyRequiredWithoutAgent— still requires key without agentTestSSHClient_SudoPrefix_Default/_NoSudo— prefix behaviorTestSSHClient_Call_NoSudo— command string omits sudoTestSSHClient_CallAndWait_NoSudo— same for job calls🤖 Generated with Claude Code