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

Method ensure_app_attestation_allowed

kms/src/main_service.rs:247–271  ·  view source on GitHub ↗
(
        &self,
        att: &VerifiedAttestation,
        is_kms: bool,
        use_boottime_mr: bool,
        vm_config_str: &str,
    )

Source from the content-addressed store, hash-verified

245 }
246
247 async fn ensure_app_attestation_allowed(
248 &self,
249 att: &VerifiedAttestation,
250 is_kms: bool,
251 use_boottime_mr: bool,
252 vm_config_str: &str,
253 ) -> Result<BootConfig> {
254 let boot_info = build_boot_info(att, use_boottime_mr, vm_config_str)?;
255 let response = self
256 .state
257 .config
258 .auth_api
259 .is_app_allowed(&boot_info, is_kms)
260 .await?;
261 if !response.is_allowed {
262 bail!("Boot denied: {}", response.reason);
263 }
264 self.verify_os_image_hash(vm_config_str.into(), att)
265 .await
266 .context("Failed to verify os image hash")?;
267 Ok(BootConfig {
268 boot_info,
269 gateway_app_id: response.gateway_app_id,
270 })
271 }
272
273 fn derive_app_ca(&self, app_id: &[u8]) -> Result<CaCert> {
274 let context_data = vec![app_id, b"app-ca"];

Callers 3

ensure_kms_allowedMethod · 0.80
sign_certMethod · 0.80

Calls 3

build_boot_infoFunction · 0.85
is_app_allowedMethod · 0.80
verify_os_image_hashMethod · 0.45

Tested by

no test coverage detected