1use std::collections::HashSet;
6
7use voa_config::openpgp::{
8 DomainName,
9 TrustAmountFlow,
10 TrustAmountPartial,
11 WebOfTrustMode,
12 WebOfTrustRoot,
13};
14
15use crate::OpenpgpCert;
16
17#[derive(Debug)]
19#[allow(dead_code)]
20pub(crate) struct WebOfTrustModel<'a> {
21 pub(crate) flow_amount: TrustAmountFlow,
23
24 pub(crate) partial_amount: TrustAmountPartial,
26
27 pub(crate) roots: &'a HashSet<WebOfTrustRoot>,
29
30 pub(crate) artifact_verifier_identity_domain_matches: &'a HashSet<DomainName>,
34}
35
36impl<'a> WebOfTrustModel<'a> {
37 pub(crate) fn new(
38 config: &'a WebOfTrustMode,
39 _artifact_verifiers: &'a [OpenpgpCert],
40 _trust_anchors: &'a [OpenpgpCert],
41 ) -> Self {
42 WebOfTrustModel {
43 flow_amount: config.flow_amount(),
44 partial_amount: config.partial_amount(),
45 roots: config.roots(),
46 artifact_verifier_identity_domain_matches: config
47 .artifact_verifier_identity_domain_matches(),
48 }
49 }
50}