Add keyless (none) SSH authentication for Tailscale/WireGuard hosts - #60
Add keyless (none) SSH authentication for Tailscale/WireGuard hosts#60borisevstratov wants to merge 2 commits into
Conversation
Adds a third SSHAuthenticationKind, .none, alongside password and private key, so servers reachable only through an already-authenticated tunnel no longer require a password or key. Offers SSH's `none` auth method once via Citadel's SSHAuthenticationMethod.custom(_:) hook, with no changes needed to the Citadel/swift-nio-ssh forks. Fixes h3nock#57
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
XCTAssertEqual(savedCredential, .none) resolved .none to Optional<SSHCredential>.none (nil) instead of SSHCredential.none, since savedCredential is SSHCredential? and SSHCredential itself has a .none case. Disambiguate with SSHCredential.none.
|
@borisevstratov this is really neat. thanks for putting this together. somehow i missed the prev notification here. the Moshi flow is a great reference too. i'm on it. |
But your taste and minimal aesthetics are way beyond moshi! |
haha thanks, really appreciate that! |


Addresses #57
Used Claude Code for this one. Basically it just added a new auth strategy, so should be OK.
@h3nock could you please verify the code, and build. Thanks!
Summary
SSHAuthenticationKind,.none, alongside password and private key, so servers reachable only through an already-authenticated tunnel (Tailscale, WireGuard) no longer require a password or private key..noneuniformly through the existing domain model, validator, Keychain-backedSSHCredentialStore,SSHAuthResolver, andRemuxRootModel's identity/credential save paths, mirroring the existing password/private-key code paths rather than special-casing credential lookup.NoneSSHAuthenticationDelegateinSSHAuthenticationMethodFactorythat offers SSH'snoneauth method once via Citadel'sSSHAuthenticationMethod.custom(_:)hook. No changes needed to the Citadel/swift-nio-ssh forks —NIOSSHUserAuthenticationOffer.Offer.noneis already supported end-to-end there.docs/architecture.md.Fixes #57
Test plan
.github/workflows/ci.yml) build + test pass on a macOS runner with full Xcode — could not runxcodebuild/tests locally in the environment this PR was authored in (Command Line Tools only, no Xcode.app).SSHAuthResolverTests,TmuxConnectionDraftValidatorTests,RemuxRootModelTests(new-server save + direct connect), and a KeychainSSHCredentialCodable round-trip test.noneauth (e.g. reachable only via a Tailscale/WireGuard tunnel with sshd configured to allow it).