Some cleanups
- Remove unused errors. - Add doc comments.
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
//! Error typ
|
||||
//! Husk Error type
|
||||
|
||||
use thiserror::Error;
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ use sequoia_wot as wot;
|
||||
use wot::{CertSynopsis, Certification};
|
||||
use sequoia_openpgp::{cert::ValidCert, policy::StandardPolicy};
|
||||
use sequoia_openpgp::Cert;
|
||||
use sequoia_openpgp::Fingerprint;
|
||||
|
||||
use crate::types::husk_context::HuskContext;
|
||||
use crate::common::crypto;
|
||||
@@ -15,14 +14,6 @@ use crate::common::crypto;
|
||||
pub enum IntroducerError {
|
||||
#[error("Unsuitable certificate")]
|
||||
UnsuitableCertificate,
|
||||
#[error("Unlimited introducer")]
|
||||
UnlimitedIntroducer,
|
||||
#[error("Invalid domain name: '{0}'")]
|
||||
InvalidDomainName(String),
|
||||
#[error("Certificate {0} contains no usable user id")]
|
||||
NoUserIDs(Fingerprint),
|
||||
#[error("Local trust root is damanged")]
|
||||
RootDamaged,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
@@ -33,6 +24,10 @@ pub struct Introducer {
|
||||
|
||||
impl Introducer {
|
||||
|
||||
/// Can this introducer potentially introduce `email`?
|
||||
///
|
||||
/// This check matches the email with the list of domains of the
|
||||
/// introducer.
|
||||
pub fn can_introduce(&self, email: &str) -> bool {
|
||||
if let Some(regexset) = self.certification.regular_expressions() {
|
||||
if regexset.matches_everything() {
|
||||
|
||||
Reference in New Issue
Block a user