duplicate_authorized_keys

Function duplicate_authorized_keys 

Source
pub(crate) fn duplicate_authorized_keys(
    mappings: &BTreeSet<impl MappingAuthorizedKeyEntry>,
) -> Option<String>
Expand description

Collects all duplicate SSH public keys used in authorized_keys.

Accepts a set of MappingAuthorizedKeyEntry implementations.

ยงNote

Compares the actual [KeyData][ssh_key::public::KeyData] of the underlying [PublicKey], because we are interested in whether there are direct matches and we do not consider a public key comment an invariant. The ssh-key upstream derives Eq, Hash, Ord, PartialEq and PartialOrd for [PublicKey] which means that public key comments are considered as invariants, even if the [KeyData][ssh_key::public::KeyData] matches!