Skip to content

Commit c7f02ba

Browse files
committed
refactor(api): remove unused app info attestation mode
Drop the write-only AppInfo.attestation field and its backend, simulator, SDK, and documentation plumbing. GetQuoteResponse.attestation remains the platform-agnostic evidence field.
1 parent 0e6295d commit c7f02ba

10 files changed

Lines changed: 7 additions & 57 deletions

File tree

dstack/guest-agent-simulator/src/main.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use dstack_guest_agent::{
1414
run_server, AppState,
1515
};
1616
use dstack_guest_agent_rpc::{AttestResponse, GetQuoteResponse};
17-
use ra_tls::attestation::{PlatformEvidence, VersionedAttestation};
17+
use ra_tls::attestation::VersionedAttestation;
1818
use serde::Deserialize;
1919
use tracing::warn;
2020

@@ -89,17 +89,6 @@ impl PlatformBackend for SimulatorPlatform {
8989
fn attest_response(&self, report_data: [u8; 64]) -> Result<AttestResponse> {
9090
simulator::simulated_attest_response(&self.attestation, report_data, self.patch_report_data)
9191
}
92-
93-
fn attestation_mode(&self) -> Result<String> {
94-
let mode = match self.attestation.clone().into_v1().platform {
95-
PlatformEvidence::Tdx { .. } => "dstack-tdx",
96-
PlatformEvidence::GcpTdx { .. } => "dstack-gcp-tdx",
97-
PlatformEvidence::NitroEnclave { .. } => "dstack-nitro-enclave",
98-
PlatformEvidence::AwsNitroTpm { .. } => "dstack-aws-nitro-tpm",
99-
PlatformEvidence::SevSnp { .. } => "dstack-amd-sev-snp",
100-
};
101-
Ok(mode.to_string())
102-
}
10392
}
10493

10594
#[rocket::main]

dstack/guest-agent/rpc/proto/agent_rpc.proto

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,6 @@ message AppInfo {
230230
string cloud_vendor = 15;
231231
// Cloud provider product_name (e.g. "Google Compute Engine")
232232
string cloud_product = 16;
233-
// Detected dstack attestation mode, e.g. `dstack-tdx`, `dstack-aws-nitro-tpm`.
234-
string attestation = 17;
235233
}
236234

237235
// The response to a Version request

dstack/guest-agent/src/backend.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,13 @@
55
use anyhow::{Context, Result};
66
use dstack_guest_agent_rpc::{AttestResponse, GetQuoteResponse};
77
use ra_tls::attestation::Attestation;
8-
use ra_tls::attestation::{AttestationMode, QuoteContentType, VersionedAttestation};
8+
use ra_tls::attestation::{QuoteContentType, VersionedAttestation};
99

1010
pub trait PlatformBackend: Send + Sync {
1111
fn attestation_for_info(&self) -> Result<VersionedAttestation>;
1212
fn certificate_attestation(&self, pubkey: &[u8]) -> Result<VersionedAttestation>;
1313
fn quote_response(&self, report_data: [u8; 64], vm_config: &str) -> Result<GetQuoteResponse>;
1414
fn attest_response(&self, report_data: [u8; 64]) -> Result<AttestResponse>;
15-
/// The detected dstack attestation mode string (e.g. `dstack-tdx`),
16-
/// surfaced in `AppInfo.attestation`.
17-
fn attestation_mode(&self) -> Result<String>;
1815
}
1916

2017
#[derive(Debug, Default)]
@@ -35,7 +32,7 @@ impl PlatformBackend for RealPlatform {
3532
}
3633

3734
fn quote_response(&self, report_data: [u8; 64], vm_config: &str) -> Result<GetQuoteResponse> {
38-
let attestation = Attestation::quote(&report_data).context("failed to get quote")?;
35+
let attestation = Attestation::quote(&report_data).context("Failed to get quote")?;
3936
let tdx_quote = attestation.get_tdx_quote_bytes();
4037
let tdx_event_log = attestation.get_tdx_event_log_string_for_config(vm_config);
4138
// TDX callers already have quote + event_log. Only non-TDX platforms
@@ -58,13 +55,9 @@ impl PlatformBackend for RealPlatform {
5855
}
5956

6057
fn attest_response(&self, report_data: [u8; 64]) -> Result<AttestResponse> {
61-
let attestation = Attestation::quote(&report_data).context("failed to get attestation")?;
58+
let attestation = Attestation::quote(&report_data).context("Failed to get attestation")?;
6259
Ok(AttestResponse {
6360
attestation: attestation.into_versioned().to_bytes()?,
6461
})
6562
}
66-
67-
fn attestation_mode(&self) -> Result<String> {
68-
Ok(AttestationMode::detect()?.as_str().to_string())
69-
}
7063
}

dstack/guest-agent/src/http_routes.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ async fn index(state: &State<AppState>) -> Result<RawHtml<String>, String> {
5050
vm_config: _,
5151
cloud_vendor,
5252
cloud_product,
53-
attestation: _,
5453
} = handler
5554
.info()
5655
.await

dstack/guest-agent/src/rpc_service.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,6 @@ impl AppState {
179179
fn attest_response(&self, report_data: [u8; 64]) -> Result<AttestResponse> {
180180
self.inner.platform.attest_response(report_data)
181181
}
182-
183-
fn attestation_mode(&self) -> Result<String> {
184-
self.inner.platform.attestation_mode()
185-
}
186182
}
187183

188184
pub struct InternalRpcHandler {
@@ -251,7 +247,6 @@ pub async fn get_info(state: &AppState, external: bool) -> Result<AppInfo> {
251247
vm_config,
252248
cloud_vendor: read_dmi_file("sys_vendor"),
253249
cloud_product: read_dmi_file("product_name"),
254-
attestation: state.attestation_mode()?,
255250
})
256251
}
257252

@@ -855,10 +850,6 @@ pNs85uhOZE8z2jr8Pg==
855850
attestation: VersionedAttestation::V1 { attestation }.to_bytes()?,
856851
})
857852
}
858-
859-
fn attestation_mode(&self) -> Result<String> {
860-
Ok("dstack-tdx".to_string())
861-
}
862853
}
863854

864855
let inner = AppStateInner {
@@ -1127,16 +1118,6 @@ pNs85uhOZE8z2jr8Pg==
11271118
assert_eq!(normalize_algorithm("unknown"), "unknown");
11281119
}
11291120

1130-
#[tokio::test]
1131-
async fn info_reports_attestation_mode() {
1132-
let (state, _guard) = setup_test_state().await;
1133-
let handler = InternalRpcHandler { state };
1134-
1135-
let info = handler.info().await.unwrap();
1136-
1137-
assert_eq!(info.attestation, "dstack-tdx");
1138-
}
1139-
11401121
#[tokio::test]
11411122
async fn test_get_key_k256_alias() {
11421123
let (state, _guard) = setup_test_state().await;

sdk/curl/api.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ The `event_log` field contains a JSON array of TDX event log entries. For RTMR 0
149149

150150
### 4. Get Info
151151

152-
Retrieves worker information, including the detected cloud platform and dstack attestation mode.
152+
Retrieves worker information, including the detected cloud platform.
153153

154154
**Endpoint:** `/Info`
155155

@@ -173,12 +173,11 @@ curl --unix-socket /var/run/dstack.sock http://dstack/Info
173173
"compose_hash": "<hex-encoded-compose-hash>",
174174
"vm_config": "<json-vm-config-string>",
175175
"cloud_vendor": "<detected-cloud-vendor>",
176-
"cloud_product": "<detected-cloud-product>",
177-
"attestation": "dstack-aws-nitro-tpm"
176+
"cloud_product": "<detected-cloud-product>"
178177
}
179178
```
180179

181-
The `cloud_vendor`, `cloud_product`, and `attestation` fields report the detected cloud platform and dstack attestation mode (for example, `dstack-tdx` or `dstack-aws-nitro-tpm`).
180+
The `cloud_vendor` and `cloud_product` fields report the detected cloud platform.
182181

183182
### 5. Sign (not yet released)
184183

sdk/go/dstack/client.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,6 @@ type InfoResponse struct {
162162
VmConfig string `json:"vm_config,omitempty"`
163163
CloudVendor string `json:"cloud_vendor,omitempty"`
164164
CloudProduct string `json:"cloud_product,omitempty"`
165-
// Detected dstack attestation mode, e.g. "dstack-tdx", "dstack-aws-nitro-tpm".
166-
Attestation string `json:"attestation,omitempty"`
167165
}
168166

169167
// DecodeTcbInfo decodes the TcbInfo string into a TcbInfo struct

sdk/js/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ export interface InfoResponse<VersionTcbInfo extends TcbInfo> {
9191
cloud_vendor?: string
9292
// Cloud provider product_name (e.g. "Google Compute Engine"). Available on dstack OS >= 0.5.7.
9393
cloud_product?: string
94-
// Detected dstack attestation mode, e.g. "dstack-tdx", "dstack-aws-nitro-tpm".
95-
attestation?: string
9694
}
9795

9896
export interface GetQuoteResponse {

sdk/python/src/dstack_sdk/dstack_client.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,6 @@ class InfoResponse(BaseModel, Generic[T]):
265265
cloud_vendor: str = ""
266266
# Cloud provider product_name (e.g. "Google Compute Engine"). Available on dstack OS >= 0.5.7.
267267
cloud_product: str = ""
268-
# Detected dstack attestation mode, e.g. "dstack-tdx", "dstack-aws-nitro-tpm".
269-
attestation: str = ""
270268

271269
@classmethod
272270
def parse_response(cls, obj: Any, tcb_info_type: type[T]) -> "InfoResponse[T]":

sdk/rust/types/src/dstack.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,6 @@ pub struct InfoResponse {
199199
/// VM configuration
200200
#[serde(default)]
201201
pub vm_config: String,
202-
/// Detected dstack attestation mode, e.g. `dstack-tdx`, `dstack-aws-nitro-tpm`.
203-
#[serde(default)]
204-
pub attestation: String,
205202
}
206203

207204
impl InfoResponse {

0 commit comments

Comments
 (0)