pub struct IdentityFilter { /* private fields */ }Expand description
An IdentityFilter can determine if an Identity provided by the ssh-agent is trusted or not by this plugin. It is constructed from files or commands providing regular ssh keys or cert-authority keys.
Implementations§
Source§impl IdentityFilter
impl IdentityFilter
Sourcepub fn new(
authorized_keys_file: &Path,
ca_keys_file: Option<&Path>,
authorized_keys_command: Option<&str>,
authorized_keys_command_user: Option<&str>,
calling_user: &str,
) -> Result<Self>
pub fn new( authorized_keys_file: &Path, ca_keys_file: Option<&Path>, authorized_keys_command: Option<&str>, authorized_keys_command_user: Option<&str>, calling_user: &str, ) -> Result<Self>
Construct a new Identity filter with the provided authorized_keys file and optionally also ca_keys_file, authorized_keys_command and authorized_keys_command_user. The authorized_keys_command will be invoked when specified, and its output will be treated as additional lines in the authorized_keys file. If authorized_keys_command_user is not specified, the identity of the calling user will be used when executing he command.
Sourcepub fn filter(&self, identity: &Identity<'_>) -> bool
pub fn filter(&self, identity: &Identity<'_>) -> bool
Returns true if the provided Identity is a PublicKey and this filter is configured with the same public key, or if the Identity is a Certificate and this filter is configured with a matching cert authority key. Please note that for certificates this is not enough, see auth::validate_cert for more information.