Deprecated async client kept for backward compatibility. DEPRECATED: Use ``AsyncDstackClient`` instead.
| 635 | |
| 636 | |
| 637 | class AsyncTappdClient(AsyncDstackClient): |
| 638 | """Deprecated async client kept for backward compatibility. |
| 639 | |
| 640 | DEPRECATED: Use ``AsyncDstackClient`` instead. |
| 641 | """ |
| 642 | |
| 643 | def __init__( |
| 644 | self, |
| 645 | endpoint: str | None = None, |
| 646 | *, |
| 647 | use_sync_http: bool = False, |
| 648 | timeout: float = 3, |
| 649 | ): |
| 650 | """Initialize deprecated async tappd client wrapper.""" |
| 651 | if not use_sync_http: |
| 652 | # Already warned in TappdClient.__init__ |
| 653 | emit_deprecation_warning( |
| 654 | "AsyncTappdClient is deprecated, please use AsyncDstackClient instead" |
| 655 | ) |
| 656 | |
| 657 | endpoint = get_tappd_endpoint(endpoint) |
| 658 | super().__init__(endpoint, use_sync_http=use_sync_http, timeout=timeout) |
| 659 | # Set the correct path prefix for tappd |
| 660 | self.PATH_PREFIX = "/prpc/Tappd." |
| 661 | |
| 662 | async def derive_key( |
| 663 | self, |
| 664 | path: str | None = None, |
| 665 | subject: str | None = None, |
| 666 | alt_names: List[str] | None = None, |
| 667 | ) -> GetTlsKeyResponse: |
| 668 | """Use ``get_key`` instead (deprecated).""" |
| 669 | emit_deprecation_warning("derive_key is deprecated, please use get_key instead") |
| 670 | |
| 671 | data: Dict[str, Any] = { |
| 672 | "path": path or "", |
| 673 | "subject": subject or path or "", |
| 674 | } |
| 675 | if alt_names: |
| 676 | data["alt_names"] = alt_names |
| 677 | |
| 678 | result = await self._send_rpc_request("DeriveKey", data) |
| 679 | return GetTlsKeyResponse(**result) |
| 680 | |
| 681 | async def tdx_quote( |
| 682 | self, |
| 683 | report_data: str | bytes, |
| 684 | hash_algorithm: str | None = None, |
| 685 | ) -> GetQuoteResponse: |
| 686 | """Use ``get_quote`` instead (deprecated).""" |
| 687 | emit_deprecation_warning( |
| 688 | "tdx_quote is deprecated, please use get_quote instead" |
| 689 | ) |
| 690 | |
| 691 | if not report_data or not isinstance(report_data, (bytes, str)): |
| 692 | raise ValueError("report_data can not be empty") |
| 693 | |
| 694 | report_bytes: bytes = ( |
no outgoing calls