Look up a cached, unexpired, active key for (server, identity name). Returns `None` when the (server, name) pair is unknown, the entry is expired, or the identity is not `active` — in all cases the caller should fall back to the server.
(&self, server_url: &str, name: &str)
| 128 | /// expired, or the identity is not `active` — in all cases the caller |
| 129 | /// should fall back to the server. |
| 130 | pub fn get(&self, server_url: &str, name: &str) -> Option<CachedKey> { |
| 131 | if let Some(entry) = self.entries.get(name) { |
| 132 | if entry.server_url != server_url { |
| 133 | return None; |
| 134 | } |
| 135 | if entry.status != "active" { |
| 136 | return None; |
| 137 | } |
| 138 | if Utc::now() >= entry.expires_at { |
| 139 | return None; |
| 140 | } |
| 141 | return Some(CachedKey { |
| 142 | public_key: entry.public_key.clone(), |
| 143 | resolved_at: entry.resolved_at, |
| 144 | }); |
| 145 | } |
| 146 | None |
| 147 | } |
| 148 | |
| 149 | /// Store a resolution and persist it. |
| 150 | /// |