Skip to main content

ConnectOptions

Struct ConnectOptions 

Source
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: PathBuf

The path to the SSH agent socket used for the connection to user on the Signstar system(s).

§user_public_key: PublicKey

The 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

Source

pub fn agent_socket(self, agent_socket: impl Into<PathBuf>) -> Self

Sets the path to an OpenSSH agent socket for client authentication.

Source

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.

Source

pub fn new( host: String, client_auth_public_key: impl AsRef<str>, ) -> Result<Self, Error>

Constructs a new ConnectOptions with target host and client public key.

Trait Implementations§

Source§

impl Debug for ConnectOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ConnectOptions

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Validate for ConnectOptions

Source§

type Context = ()

A user-provided context. Read more
Source§

fn validate_into( &self, __garde_user_ctx: &Self::Context, __garde_path: &mut dyn FnMut() -> Path, __garde_report: &mut Report, )

Validates Self, aggregating all validation errors into Report.
§

fn validate(&self) -> Result<(), Report>
where Self::Context: Default,

Validates 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>

Validates Self, returning an Err with an aggregate of all errors if the validation failed. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,