Every stored binding loads and passes its cryptographic verification (payload validity + signature).
(repo: &Repository)
| 92 | /// Every stored binding loads and passes its cryptographic verification |
| 93 | /// (payload validity + signature). |
| 94 | fn binding_census_class(repo: &Repository) -> CensusClass { |
| 95 | let name = "census/bindings"; |
| 96 | match repo.binding_ids() { |
| 97 | Ok(ids) => { |
| 98 | let total = ids.len(); |
| 99 | let mut invalid: Vec<String> = Vec::new(); |
| 100 | let mut unloaded: Vec<String> = Vec::new(); |
| 101 | for id in &ids { |
| 102 | match repo.load_binding(id) { |
| 103 | Ok(Some(binding)) => { |
| 104 | if verify_binding_cryptography(&binding).is_err() { |
| 105 | invalid.push(binding_id_hex(id)); |
| 106 | } |
| 107 | } |
| 108 | Ok(None) => unloaded.push(binding_id_hex(id)), |
| 109 | Err(error) => unloaded.push(format!( |
| 110 | "{} ({})", |
| 111 | binding_id_hex(id), |
| 112 | repository_error(error) |
| 113 | )), |
| 114 | } |
| 115 | } |
| 116 | if invalid.is_empty() && unloaded.is_empty() { |
| 117 | CensusClass { |
| 118 | name, |
| 119 | clean: true, |
| 120 | detail: format!("{total} stored binding(s) verify"), |
| 121 | } |
| 122 | } else { |
| 123 | CensusClass { |
| 124 | name, |
| 125 | clean: false, |
| 126 | detail: format!( |
| 127 | "{} invalid binding(s) [{}], {} unloadable [{}]", |
| 128 | invalid.len(), |
| 129 | invalid.join(", "), |
| 130 | unloaded.len(), |
| 131 | unloaded.join(", ") |
| 132 | ), |
| 133 | } |
| 134 | } |
| 135 | } |
| 136 | Err(error) => CensusClass { |
| 137 | name, |
| 138 | clean: false, |
| 139 | detail: format!("cannot enumerate bindings: {error}"), |
| 140 | }, |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | /// Every working-copy record names an existing view; the CURRENT working |
| 145 | /// copy's staleness is the durable layer's verdict, and other working |
nothing calls this directly
no test coverage detected