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

Function print_attestation_json

atomic-cli/src/commands/rpc.rs:1109–1134  ·  view source on GitHub ↗
(session: &Service, info: &pb::AttestationInfo)

Source from the content-addressed store, hash-verified

1107}
1108
1109fn print_attestation_json(session: &Service, info: &pb::AttestationInfo) -> CliResult<()> {
1110 let path = info.vault_path.as_deref().ok_or_else(|| {
1111 CliError::Internal(anyhow::anyhow!("the service returned no attestation path"))
1112 })?;
1113 let response = session.get_vault_entry(pb::GetVaultEntryRequest {
1114 repository: Some(session.reference.clone()),
1115 kind: Kind::Unspecified as i32,
1116 id: String::new(),
1117 path: Some(path.trim_start_matches(".vault/").to_string()),
1118 include_bundle: true,
1119 view: None,
1120 })?;
1121 let bundle = response.entry_bundle.as_ref().ok_or_else(|| {
1122 CliError::Internal(anyhow::anyhow!(
1123 "the service returned no attestation bundle"
1124 ))
1125 })?;
1126 let bundle = parse_entry_bundle(bundle)?;
1127 let node: serde_json::Value = serde_json::from_slice(&bundle.entry.content_bytes)
1128 .map_err(|error| CliError::Internal(anyhow::anyhow!("attested node: {error}")))?;
1129 println!(
1130 "{}",
1131 serde_json::to_string_pretty(&node).map_err(|error| CliError::Internal(error.into()))?
1132 );
1133 Ok(())
1134}
1135
1136pub fn intent_validate(args: &super::intent::validate::IntentValidate) -> CliResult<bool> {
1137 // Path-arg form reads a file, no redb — stays local.

Callers 2

intent_attestFunction · 0.85
memory_attestFunction · 0.85

Calls 4

parse_entry_bundleFunction · 0.85
as_refMethod · 0.80
get_vault_entryMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected