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

Method check_revocation

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

Source from the content-addressed store, hash-verified

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

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_urnMethod · 0.80
to_base32Method · 0.45

Tested by

no test coverage detected