MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / bound_servers

Method bound_servers

atomic-cli/src/commands/identity/delegate.rs:294–311  ·  view source on GitHub ↗

Which servers this grant is valid against. Explicit `--server-url` wins; otherwise the active profile, so the safe thing happens by default. `--any-server` is the deliberate opt-out, and an unresolvable profile is *not* silently treated as "any" — that would turn a misconfiguration into a grant broader than anyone asked for.

(&self)

Source from the content-addressed store, hash-verified

292 /// an unresolvable profile is *not* silently treated as "any" — that would
293 /// turn a misconfiguration into a grant broader than anyone asked for.
294 fn bound_servers(&self) -> CliResult<Vec<String>> {
295 if self.any_server {
296 return Ok(Vec::new());
297 }
298 if !self.server_urls.is_empty() {
299 return Ok(self.server_urls.clone());
300 }
301
302 match crate::commands::client::apex_server_url(self.server.as_deref()) {
303 Ok(url) => Ok(vec![url]),
304 Err(_) => Err(CliError::InvalidArgument {
305 message: "No server configured, so this grant cannot be bound to one.\n \
306 Pass --server-url <url>, or --any-server if you really mean a \
307 grant valid against every deployment."
308 .to_string(),
309 }),
310 }
311 }
312
313 /// Verify a self-signed request and turn it into a delegate identity.
314 ///

Callers 1

build_scopeMethod · 0.80

Calls 3

apex_server_urlFunction · 0.50
is_emptyMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected