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

Method check_revocation

atomic-cli/src/commands/identity/delegation.rs:406–434  ·  view source on GitHub ↗
(&self, delegation: &atomic_identity::delegation::Delegation)

Source from the content-addressed store, hash-verified

404 }
405
406 async fn check_revocation(&self, delegation: &atomic_identity::delegation::Delegation) {
407 let store = match IdentityStore::open_default() {
408 Ok(s) => s,
409 Err(_) => return,
410 };
411 if store.is_revoked_locally(&delegation.id.to_base32()) {
412 println!("✗ Revoked recorded locally");
413 return;
414 }
415
416 let Ok(delegator) = store.load_by_name(&delegation.delegator_name) else {
417 println!("- Revocation not checked (delegator not on this machine)");
418 return;
419 };
420 let Ok((client, url)) =
421 crate::commands::client::build_apex_client_as(&delegator, self.server.as_deref()).await
422 else {
423 println!("- Revocation not checked (no server reachable)");
424 return;
425 };
426
427 match client.delegation_status(&delegation.id.to_urn()).await {
428 Ok(status) if status.revoked => {
429 println!("✗ Revoked {url} reports this grant revoked")
430 }
431 Ok(_) => println!("✓ Not revoked (checked {url})"),
432 Err(e) => println!("- Revocation not checked ({e})"),
433 }
434 }
435}
436
437// ---------------------------------------------------------------------------

Callers 1

executeMethod · 0.80

Calls 6

build_apex_client_asFunction · 0.85
is_revoked_locallyMethod · 0.80
load_by_nameMethod · 0.80
delegation_statusMethod · 0.80
to_base32Method · 0.45
to_urnMethod · 0.45

Tested by

no test coverage detected