Namespace SshSharp.Extensions.DependencyInjection
Classes
- SshConnectionEvent
A change of an endpoint's shared connection, from WatchAsync(string, CancellationToken). It names the endpoint by its registered name only; no host or user name is in it.
- SshConnectionProviderExtensions
SFTP on the shared connections of ISshConnectionProvider and ISshEndpoint.
- SshEndpointJumpHost
A jump host (bastion) for JumpHosts: where it is, how to log in to it and how to verify its host key, as
ssh -Jand ssh_config'sProxyJumpreach a server through it. Mutable, so configuration can bind to it (Ssh:Deploy:JumpHosts:0:Host). Each hop is offered only its own credentials: the endpoint's password and keys never reach a jump host, and a jump host's never reach the endpoint.
- SshEndpointOptions
One named SSH endpoint, registered with
services.AddSshClient(name): where to connect and how to authenticate. Mutable, so configuration can bind to it (.BindConfiguration("Ssh:Deploy")). Set either ConfigAlias, to connect throughssh_config, or Host.
- SshEndpointPrivateKey
A private key given as a value, for PrivateKeys: the key text itself rather than a file, as containers and secret stores supply it (an environment variable, a mounted Kubernetes secret bound through configuration, Key Vault, user secrets). Mutable, so configuration can bind to it (
Ssh:Deploy:PrivateKeys:0:Key). Neither the key nor the passphrase appears in ToString() or in the debugger.
Interfaces
- ISshClientFactory
Opens new connections to the endpoints registered with
services.AddSshClient(name).
- ISshConnectionProvider
One long-lived connection per endpoint registered with
services.AddSshClient(name), shared by its callers and opened again when it drops. The provider owns the clients and disposes them with the container: callers must not dispose them.
- ISshEndpoint
One endpoint registered with
services.AddSshClient(name), resolved by its name as a keyed service:[FromKeyedServices("deploy")] ISshEndpoint deploy, orGetRequiredKeyedService<ISshEndpoint>("deploy"). It is ISshConnectionProvider and ISshClientFactory for that one name, with the same lifetimes: a singleton, whose shared connection is the provider's.
Enums
- SshConnectionEventKind
What happened to an endpoint's shared connection, in a SshConnectionEvent.