Skip to content

feat: add SSHClient handshake and auth timeouts#182

Merged
vicajilau merged 1 commit into
TerminalStudio:masterfrom
lollipopkit:upstream/client-handshake-auth-timeouts
Jul 3, 2026
Merged

feat: add SSHClient handshake and auth timeouts#182
vicajilau merged 1 commit into
TerminalStudio:masterfrom
lollipopkit:upstream/client-handshake-auth-timeouts

Conversation

@GT-610

@GT-610 GT-610 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

This is a backport from ServerBox's fork.

It adds two optional SSHClient timeout controls:

  • handshakeTimeout: maximum time to wait for the transport handshake to reach ready state
  • authTimeout: maximum time to wait for user authentication after the transport is ready

Both options default to null, so existing behavior is unchanged unless callers opt in.

On timeout:

  • handshake timeout completes client.authenticated with SSHHandshakeError('Handshake timed out')
  • auth timeout completes client.authenticated with SSHAuthAbortError('Authentication timed out')

Timers are cancelled on success, connection close, and error paths.

Test plan

  • dart test test/src/ssh_client_timeout_test.dart test/src/ssh_auth_abort_error_test.dart test/src/ssh_client_ident_test.dart test/src/ssh_client_run_with_result_test.dart
  • dart analyze lib/src/ssh_client.dart test/src/ssh_client_timeout_test.dart

@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.34%. Comparing base (c2bf398) to head (796b42e).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #182      +/-   ##
==========================================
+ Coverage   54.85%   55.34%   +0.49%     
==========================================
  Files          66       66              
  Lines        5423     5449      +26     
==========================================
+ Hits         2975     3016      +41     
+ Misses       2448     2433      -15     
Flag Coverage Δ
unittests 55.34% <100.00%> (+0.49%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
lib/src/ssh_client.dart 22.95% <100.00%> (+5.28%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vicajilau vicajilau merged commit 3982646 into TerminalStudio:master Jul 3, 2026
3 checks passed
@GT-610 GT-610 deleted the upstream/client-handshake-auth-timeouts branch July 3, 2026 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants