pub struct AllowedSigners { /* private fields */ }Expand description
The parsed contents of an allowed_signers file.
Implementations§
Source§impl AllowedSigners
impl AllowedSigners
Sourcepub fn parse(input: &str) -> Result<Self, GitwayError>
pub fn parse(input: &str) -> Result<Self, GitwayError>
Parses an allowed_signers document from a string.
§Errors
Returns GitwayError on the first malformed line.
Sourcepub fn load(path: &Path) -> Result<Self, GitwayError>
pub fn load(path: &Path) -> Result<Self, GitwayError>
Loads and parses an allowed_signers file from disk.
§Errors
Returns GitwayError if the file cannot be read or contains
malformed lines.
Sourcepub fn find_principals<'a>(
&'a self,
public_key: &PublicKey,
namespace: &str,
) -> Vec<&'a str>
pub fn find_principals<'a>( &'a self, public_key: &PublicKey, namespace: &str, ) -> Vec<&'a str>
Returns the principals authorized to sign under namespace with public_key.
An entry matches when its public key equals public_key exactly and
either has no namespaces restriction or includes namespace in its
list.
Returns true if any entry authorizes identity to sign under
namespace with public_key.
identity is matched against each entry’s principal patterns using
fnmatch-style globs (*, ?, character classes). Negation prefixes
(!pattern) are honored — a matching negation rejects the entry.
Trait Implementations§
Source§impl Clone for AllowedSigners
impl Clone for AllowedSigners
Source§fn clone(&self) -> AllowedSigners
fn clone(&self) -> AllowedSigners
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more