MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / verify_app

Method verify_app

dstack-util/src/system_setup.rs:1348–1376  ·  view source on GitHub ↗
(&self, app_info: &AppInfo, keys: &AppKeys)

Source from the content-addressed store, hash-verified

1346 }
1347
1348 fn verify_app(&self, app_info: &AppInfo, keys: &AppKeys) -> Result<()> {
1349 config_id_verifier::verify_mr_config_id(
1350 &app_info.compose_hash,
1351 &app_info
1352 .instance_info
1353 .app_id
1354 .as_slice()
1355 .try_into()
1356 .ok()
1357 .context("Invalid app id")?,
1358 keys.key_provider.kind(),
1359 keys.key_provider.id(),
1360 )?;
1361 self.verify_key_provider_id(keys.key_provider.id())?;
1362 let kp_info = match &keys.key_provider {
1363 KeyProvider::None { .. } => KeyProviderInfo::new("none".into(), "".into()),
1364 KeyProvider::Local { mr, .. } => {
1365 KeyProviderInfo::new("local-sgx".into(), hex::encode(mr))
1366 }
1367 KeyProvider::Tpm { .. } => {
1368 bail!("Tpm key provider is not supported");
1369 }
1370 KeyProvider::Kms { pubkey, .. } => {
1371 KeyProviderInfo::new("kms".into(), hex::encode(pubkey))
1372 }
1373 };
1374 emit_key_provider_info(&kp_info)?;
1375 Ok(())
1376 }
1377
1378 async fn setup_fs(self) -> Result<Stage1<'a>> {
1379 let app_info = self

Callers 1

setup_fsMethod · 0.80

Calls 6

verify_mr_config_idFunction · 0.85
encodeFunction · 0.85
emit_key_provider_infoFunction · 0.85
kindMethod · 0.80
idMethod · 0.80

Tested by

no test coverage detected