MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / credentials_for_host

Method credentials_for_host

crates/openshell-prover/src/credentials.rs:142–151  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Calls 1

host_patterns_overlapFunction · 0.85