Pick the identity bound to the configured server whose host is the longest dot-boundary suffix of `remote_host`. When several profiles' hosts match with the same length (e.g. the legacy `[server]` block and a named profile pointing at the same server), the **active** profile wins — the one `default_server` selects, else the legacy block. Longest-suffix still wins over active: a more specific serv
(remote_host: &str, servers: &[ServerBinding])
| 170 | /// for hosts under both — e.g. `x.staging.atomic.storage` resolves to the |
| 171 | /// staging identity, not prod. |
| 172 | fn match_server_identity(remote_host: &str, servers: &[ServerBinding]) -> Option<String> { |
| 173 | servers |
| 174 | .iter() |
| 175 | .filter(|b| host_is_under(remote_host, &b.host)) |
| 176 | .max_by_key(|b| (b.host.len(), b.active)) |
| 177 | .map(|b| b.identity.clone()) |
| 178 | } |
| 179 | |
| 180 | /// Whether `remote_host` is the server host itself or a subdomain of it, |
| 181 | /// matching only on dot boundaries (so `notatomic.storage` does NOT match |
no test coverage detected