Expand description
Parser for the OpenSSH allowed_signers file format.
Git uses this file to map SSH public keys to the principals (usually email
addresses) that are authorized to sign commits under a given namespace.
The format is documented in ssh-keygen(1) under the ALLOWED SIGNERS
heading.
Each non-blank, non-comment line has the form:
principals [options] key-type base64-key [comment]principalsis a comma-separated list of fnmatch-style patterns (a quoted string if any pattern contains spaces).optionsis an optional comma-separated list ofkey[="value"]pairs. Onlynamespaces="<list>"is honored for git’s purposes.key-type+base64-keyis the public key, in the same wire form used byauthorized_keys.
§Examples
use gitway_lib::allowed_signers::AllowedSigners;
let signers = AllowedSigners::load(std::path::Path::new("~/.config/git/allowed_signers"))
.unwrap();
for entry in signers.entries() {
println!("{:?}", entry.principals);
}§Errors
AllowedSigners::parse rejects lines that are syntactically ill-formed
(missing key type, unterminated quoted principals, invalid base64). Blank
lines and #-comments are skipped silently.
Structs§
- Allowed
Signers - The parsed contents of an
allowed_signersfile. - Entry
- A single principal-to-key mapping parsed from an
allowed_signersfile.