Credentials that target a given host. Matching mirrors runtime host policy semantics for exact names and first-label wildcards, so a proposal for `*.github.com` is treated as credentialed when the attached credential targets `api.github.com`.
(&self, host: &str)
| 140 | /// proposal for `*.github.com` is treated as credentialed when the |
| 141 | /// attached credential targets `api.github.com`. |
| 142 | pub fn credentials_for_host(&self, host: &str) -> Vec<&Credential> { |
| 143 | self.credentials |
| 144 | .iter() |
| 145 | .filter(|c| { |
| 146 | c.target_hosts |
| 147 | .iter() |
| 148 | .any(|target| host_patterns_overlap(host, target)) |
| 149 | }) |
| 150 | .collect() |
| 151 | } |
| 152 | |
| 153 | /// API capability registry for a given host. Exact matches win, then |
| 154 | /// wildcard host overlap is used so credentialed wildcard proposals can be |