Skip to main content

Module runner

Module runner 

Source
Expand description

Thin helpers for running external SSH tools via duct.

These wrap the few operations that require shelling out: FIDO key generation, ssh-keyscan, ssh-copy-id, passphrase changes, etc. All calls go through tokio::task::spawn_blocking to avoid blocking the async runtime.

The CliRunner trait abstracts over command execution for testability. Production code uses DefaultCliRunner which delegates to toride_runner::TokioRunner; tests swap in MockCliRunner.

Structs§

DefaultCliRunner
Production CliRunner that delegates to TokioRunner from toride-runner, which uses tokio::process internally.
MockCliRunner
A canned-response CliRunner for unit tests.

Traits§

CliRunner
Abstraction over external command execution.

Functions§

ssh_add_list
Run ssh-add -l to list agent identities.
ssh_copy_id
Run ssh-copy-id -i <pubkey> <dest>.
ssh_keygen
Run ssh-keygen with the given arguments and return stdout.
ssh_keyscan
Run ssh-keyscan -H <host> and return the host key lines.
ssh_keyscan_no_hash
Run ssh-keyscan <host> (without -H) and return the host key lines.
tool_exists
Check whether a tool exists in PATH.