pub struct MtlsAccountsBuilder { /* private fields */ }Expand description
Options for MtlsAccounts; every one has a default.
Implementations§
Source§impl MtlsAccountsBuilder
impl MtlsAccountsBuilder
Sourcepub fn trust(self, trust: TrustMode) -> Self
pub fn trust(self, trust: TrustMode) -> Self
How client certificates are trusted. Default TrustMode::Pinned.
Sourcepub fn ca(self, ca: CaPolicy) -> Self
pub fn ca(self, ca: CaPolicy) -> Self
The CA and name globs that TrustMode::Ca and TrustMode::PinnedOrCa check a
chain against; ip_in_dns (on by default) lets an ip: glob match an address
written as a DNS name.
Sourcepub fn account(self, picks: Vec<Pick>) -> Self
pub fn account(self, picks: Vec<Pick>) -> Self
How a CA-trusted certificate names its account: picks tried in order over its fields
(coqui-peer-tls’s CertificateFields::to_map). Default: its fingerprint, by
certificate.
Sourcepub fn max_chain(self, most: Limit) -> Self
pub fn max_chain(self, most: Limit) -> Self
The most certificates a client may send, leaf included. Default 8.
Sourcepub fn policy(self, policy: Policy) -> Self
pub fn policy(self, policy: Policy) -> Self
The policy a chain is checked under (validity dates, algorithms). Default
[Policy::default].
Sourcepub fn table(self, table: Arc<dyn Table<PeerRecord>>) -> Self
pub fn table(self, table: Arc<dyn Table<PeerRecord>>) -> Self
Keeps the accepted peers in table instead of in memory.
Sourcepub fn waiting(self, table: Arc<dyn Table<Unaccepted>>) -> Self
pub fn waiting(self, table: Arc<dyn Table<Unaccepted>>) -> Self
Keeps the waiting fingerprints in table instead of in memory. A table that cannot be
written means nobody waits.
Sourcepub fn max_records(self, max: usize) -> Self
pub fn max_records(self, max: usize) -> Self
The most peers the table may hold. Default DEFAULT_MAX_RECORDS.
Sourcepub fn max_pins(self, max: usize) -> Self
pub fn max_pins(self, max: usize) -> Self
The most pins, fingerprints and keys together, one peer may hold. Default
DEFAULT_MAX_PINS.
Sourcepub fn record_limits(self, limits: RecordLimits) -> Self
pub fn record_limits(self, limits: RecordLimits) -> Self
How large a peer’s fields may be. Default [RecordLimits::DEFAULT].
Sourcepub fn waiting_limits(self, limits: WaitingLimits) -> Self
pub fn waiting_limits(self, limits: WaitingLimits) -> Self
The bounds on the waiting list, applied by coqui-peer’s [WaitingQueue]: places per
source, places in all (a newcomer past them is not written down; nobody is pushed out
for it), and how soon one fingerprint from one source is written down again. Default
default_waiting_limits.
Sourcepub fn build(self) -> Result<MtlsAccounts, SourceError>
pub fn build(self) -> Result<MtlsAccounts, SourceError>
Loads the table and makes the provider.
§Errors
Returns an error when the table cannot be loaded or holds an invalid or duplicated peer, or the trust needs a CA and none is given.