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

Function print_attestation_json

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

Source from the content-addressed store, hash-verified

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