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

Method attest

sdk/python/src/dstack_sdk/dstack_client.py:427–441  ·  view source on GitHub ↗

Request a versioned attestation for the provided report data.

(
        self,
        report_data: str | bytes,
    )

Source from the content-addressed store, hash-verified

425 return GetQuoteResponse(**result)
426
427 async def attest(
428 self,
429 report_data: str | bytes,
430 ) -> AttestResponse:
431 """Request a versioned attestation for the provided report data."""
432 if not report_data or not isinstance(report_data, (bytes, str)):
433 raise ValueError("report_data can not be empty")
434 report_bytes: bytes = (
435 report_data.encode() if isinstance(report_data, str) else report_data
436 )
437 if len(report_bytes) > 64:
438 raise ValueError("report_data must be less than 64 bytes")
439 hex = binascii.hexlify(report_bytes).decode()
440 result = await self._send_rpc_request("Attest", {"report_data": hex})
441 return AttestResponse(**result)
442
443 async def info(self) -> InfoResponse[TcbInfo]:
444 """Fetch service information including parsed TCB info."""

Callers 1

test_async_client_attestFunction · 0.95

Calls 3

_send_rpc_requestMethod · 0.95
AttestResponseClass · 0.70
decodeMethod · 0.45

Tested by 1

test_async_client_attestFunction · 0.76