diff --git a/src/common/verify.rs b/src/common/verify.rs index af4d9a9..327cbfd 100644 --- a/src/common/verify.rs +++ b/src/common/verify.rs @@ -15,8 +15,8 @@ use crate::{dkim::Canonicalization, Error, IprevOutput, IprevResult, Resolver}; use super::crypto::{Algorithm, VerifyingKey}; pub struct DomainKey { - pub(crate) p: Box, - pub(crate) f: u64, + pub p: Box, + pub f: u64, } impl Resolver { diff --git a/src/dkim/mod.rs b/src/dkim/mod.rs index d30306e..ea08812 100644 --- a/src/dkim/mod.rs +++ b/src/dkim/mod.rs @@ -47,23 +47,23 @@ pub struct Done; #[derive(Debug, PartialEq, Eq, Clone, Default)] pub struct Signature { - pub(crate) v: u32, - pub(crate) a: Algorithm, - pub(crate) d: String, - pub(crate) s: String, - pub(crate) b: Vec, - pub(crate) bh: Vec, - pub(crate) h: Vec, - pub(crate) z: Vec, - pub(crate) i: String, - pub(crate) l: u64, - pub(crate) x: u64, - pub(crate) t: u64, - pub(crate) r: bool, // RFC 6651 - pub(crate) atps: Option, // RFC 6541 - pub(crate) atpsh: Option, // RFC 6541 - pub(crate) ch: Canonicalization, - pub(crate) cb: Canonicalization, + pub v: u32, + pub a: Algorithm, + pub d: String, + pub s: String, + pub b: Vec, + pub bh: Vec, + pub h: Vec, + pub z: Vec, + pub i: String, + pub l: u64, + pub x: u64, + pub t: u64, + pub r: bool, // RFC 6651 + pub atps: Option, // RFC 6541 + pub atpsh: Option, // RFC 6541 + pub ch: Canonicalization, + pub cb: Canonicalization, } #[derive(Debug, PartialEq, Eq, Clone)] diff --git a/src/dmarc/mod.rs b/src/dmarc/mod.rs index 7dc5c63..eaa2dea 100644 --- a/src/dmarc/mod.rs +++ b/src/dmarc/mod.rs @@ -19,20 +19,20 @@ pub mod verify; #[derive(Debug, Hash, Clone, PartialEq, Eq)] pub struct Dmarc { - pub(crate) v: Version, - pub(crate) adkim: Alignment, - pub(crate) aspf: Alignment, - pub(crate) fo: Report, - pub(crate) np: Policy, - pub(crate) p: Policy, - pub(crate) psd: Psd, - pub(crate) pct: u8, - pub(crate) rf: u8, - pub(crate) ri: u32, - pub(crate) rua: Vec, - pub(crate) ruf: Vec, - pub(crate) sp: Policy, - pub(crate) t: bool, + pub v: Version, + pub adkim: Alignment, + pub aspf: Alignment, + pub fo: Report, + pub np: Policy, + pub p: Policy, + pub psd: Psd, + pub pct: u8, + pub rf: u8, + pub ri: u32, + pub rua: Vec, + pub ruf: Vec, + pub sp: Policy, + pub t: bool, } #[derive(Debug, Hash, Clone, PartialEq, Eq, Serialize, Deserialize)] @@ -43,13 +43,13 @@ pub struct URI { } #[derive(Debug, Hash, Clone, PartialEq, Eq)] -pub(crate) enum Alignment { +pub enum Alignment { Relaxed, Strict, } #[derive(Debug, Hash, Clone, PartialEq, Eq)] -pub(crate) enum Psd { +pub enum Psd { Yes, No, Default, diff --git a/src/lib.rs b/src/lib.rs index 7957986..f49feef 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -439,7 +439,7 @@ pub enum IprevResult { } #[derive(Debug, Hash, PartialEq, Eq, Clone)] -pub(crate) enum Version { +pub enum Version { V1, } diff --git a/src/spf/mod.rs b/src/spf/mod.rs index 80ae823..96459cf 100644 --- a/src/spf/mod.rs +++ b/src/spf/mod.rs @@ -27,7 +27,7 @@ use crate::{is_within_pct, SpfOutput, SpfResult, Version}; */ #[derive(Debug, PartialEq, Eq, Clone)] -pub(crate) enum Qualifier { +pub enum Qualifier { Pass, Fail, SoftFail, @@ -39,7 +39,7 @@ pub(crate) enum Qualifier { / a / mx / ptr / ip4 / ip6 / exists ) */ #[derive(Debug, PartialEq, Eq, Clone)] -pub(crate) enum Mechanism { +pub enum Mechanism { All, Include { macro_string: Macro, @@ -74,9 +74,9 @@ pub(crate) enum Mechanism { directive = [ qualifier ] mechanism */ #[derive(Debug, PartialEq, Eq, Clone)] -pub(crate) struct Directive { - pub(crate) qualifier: Qualifier, - pub(crate) mechanism: Mechanism, +pub struct Directive { + pub qualifier: Qualifier, + pub mechanism: Mechanism, } /* @@ -132,13 +132,13 @@ pub enum Macro { #[derive(Debug, PartialEq, Eq, Clone)] pub struct Spf { - version: Version, - directives: Vec, - exp: Option, - redirect: Option, - ra: Option>, - rp: u8, - rr: u8, + pub version: Version, + pub directives: Vec, + pub exp: Option, + pub redirect: Option, + pub ra: Option>, + pub rp: u8, + pub rr: u8, } pub(crate) const RR_TEMP_PERM_ERROR: u8 = 0x01;