pub struct MtlsAccounts { /* private fields */ }Expand description
MtlsAccounts as an Authenticator, Directory and Accounts implementation.
The table is read again whenever it reports a change.
use coqui_access::{Attempt, Authenticator, Verdict};
use coqui_access_mtls::MtlsAccounts;
let peers = MtlsAccounts::builder().build().unwrap();
let seen = peers
.authenticate(Attempt {
certificate: Some(
"sha256:0000000000000000000000000000000000000000000000000000000000000000".into(),
),
..Attempt::default()
})
.unwrap();
// Nobody accepted it: not authenticated, and kept as waiting.
assert_eq!(seen, Verdict::Unknown);Implementations§
Source§impl MtlsAccounts
impl MtlsAccounts
Sourcepub fn builder() -> MtlsAccountsBuilder
pub fn builder() -> MtlsAccountsBuilder
Options for a peer table, kept in memory unless table says
otherwise.
Trait Implementations§
Source§impl Accounts for MtlsAccounts
impl Accounts for MtlsAccounts
Source§fn put(&self, account: AccountPut) -> Result<PutOutcome, ProviderError>
fn put(&self, account: AccountPut) -> Result<PutOutcome, ProviderError>
Accepts a pin under a name, or changes what is said of a peer there is.
The secret of a peer is a pin: a certificate fingerprint in any spelling
coqui-peer-tls reads, or key:sha256:<hex> for a public key. For a new name it is
the peer’s first pin; for a peer there is it is one more, up to max_pins, and saying
one the peer holds changes nothing. remove: before a pin takes that pin away alone,
never the last one.
Source§fn accounts(&self) -> Result<Vec<AccountInfo>, ProviderError>
fn accounts(&self) -> Result<Vec<AccountInfo>, ProviderError>
Source§impl Authenticator for MtlsAccounts
impl Authenticator for MtlsAccounts
Source§fn authenticate(&self, attempt: Attempt) -> Result<Verdict, ProviderError>
fn authenticate(&self, attempt: Attempt) -> Result<Verdict, ProviderError>
Pinned first (unless the trust is ca): a known, enabled record is Valid by id, a
disabled one Invalid. Then the CA (unless the trust is pinned), for a secure
attempt carrying certificates: a trusted chain is answered by the account picks,
Ambiguous being Invalid. Anything else is Unknown, and under a pinning trust the
fingerprint waits.
Source§impl Debug for MtlsAccounts
impl Debug for MtlsAccounts
Source§impl Directory for MtlsAccounts
impl Directory for MtlsAccounts
Source§impl PinSource for MtlsAccounts
The records as a source of pins for a matcher: an enabled record named like the person
holds the fingerprint or the public key the certificate presented.
impl PinSource for MtlsAccounts
The records as a source of pins for a matcher: an enabled record named like the person holds the fingerprint or the public key the certificate presented.