pub struct ConnectOptions {
pub agent_socket: PathBuf,
pub user_public_key: PublicKey,
pub hosts: Vec<String>,
}Expand description
Connection options for sending a signature request.
The options capture target host parameters and all necessary information related to authentication for both the client (client’s public key and authentication agent) and server (a list of valid and known server public keys).
§Examples
use signstar_request_signature::ssh::client::ConnectOptions;
let options = ConnectOptions::new("localhost".into(), "ssh-ed25519 ...")?
.agent_socket(std::env::var("SSH_AUTH_SOCK")?);Fields§
§agent_socket: PathBufThe path to the SSH agent socket used for the connection to user on the Signstar
system(s).
user_public_key: PublicKeyThe SSH public key used for the connections to user on the Signstar system(s).
hosts: Vec<String>The list of Signstar hosts that the user can connect to.
Implementations§
Source§impl ConnectOptions
impl ConnectOptions
Sourcepub fn agent_socket(self, agent_socket: impl Into<PathBuf>) -> Self
pub fn agent_socket(self, agent_socket: impl Into<PathBuf>) -> Self
Sets the path to an OpenSSH agent socket for client authentication.
Sourcepub fn user_public_key(
self,
user_public_key: impl Into<String>,
) -> Result<Self, Error>
pub fn user_public_key( self, user_public_key: impl Into<String>, ) -> Result<Self, Error>
Sets an SSH public key of a client for SSH authentication.
§Examples
use signstar_request_signature::ssh::client::ConnectOptions;
let client_pk =
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILHCXBJYlPPkrt2WYyP3SZoMx43lDBB5QALjE762EQlc";
let options = ConnectOptions::new("localhost".into(), client_pk)?;§Errors
Returns an error if the public key is not well-formatted. This
function only accepts public keys following the
authorized_keys file format.
Trait Implementations§
Source§impl Debug for ConnectOptions
impl Debug for ConnectOptions
Source§impl<'de> Deserialize<'de> for ConnectOptions
impl<'de> Deserialize<'de> for ConnectOptions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Validate for ConnectOptions
impl Validate for ConnectOptions
Source§fn validate_into(
&self,
__garde_user_ctx: &Self::Context,
__garde_path: &mut dyn FnMut() -> Path,
__garde_report: &mut Report,
)
fn validate_into( &self, __garde_user_ctx: &Self::Context, __garde_path: &mut dyn FnMut() -> Path, __garde_report: &mut Report, )
Self, aggregating all validation errors into Report.§fn validate(&self) -> Result<(), Report>where
Self::Context: Default,
fn validate(&self) -> Result<(), Report>where
Self::Context: Default,
Self, returning an Err with an aggregate of all errors if
the validation failed. Read more§fn validate_with(&self, ctx: &Self::Context) -> Result<(), Report>
fn validate_with(&self, ctx: &Self::Context) -> Result<(), Report>
Self, returning an Err with an aggregate of all errors if
the validation failed. Read more