Skip to content

Commit ec234ee

Browse files
committed
add doc comments to proto definitions
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
1 parent d115c87 commit ec234ee

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed

proto/definitions/lcp/service/enclave/v1/query.proto

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,47 @@ option go_package = "github.com/datachainlab/lcp/go/relay/enclave";
77
option (gogoproto.goproto_getters_all) = false;
88

99
service Query {
10+
// Get the enclave information loaded in the service.
1011
rpc EnclaveInfo(QueryEnclaveInfoRequest) returns (QueryEnclaveInfoResponse);
12+
// Get the available enclave keys for matching the
13+
// specified MRENCLAVE and debug flag and RA type.
1114
rpc AvailableEnclaveKeys(QueryAvailableEnclaveKeysRequest) returns (QueryAvailableEnclaveKeysResponse);
15+
// Get the enclave key information for the specified enclave key address.
1216
rpc EnclaveKey(QueryEnclaveKeyRequest) returns (QueryEnclaveKeyResponse);
1317
}
1418

19+
// Request for getting the enclave information.
1520
message QueryEnclaveInfoRequest {}
1621

22+
// Response for getting the enclave information.
1723
message QueryEnclaveInfoResponse {
1824
bytes mrenclave = 1;
1925
bool enclave_debug = 2;
2026
}
2127

28+
// Request for getting the attested enclave keys corresponding to the specified MRENCLAVE.
2229
message QueryAvailableEnclaveKeysRequest {
30+
// MRENCLAVE of the enclave that generates the EK.
2331
bytes mrenclave = 1;
32+
// Debug flag of the enclave that generates the EK.
2433
bool enclave_debug = 2;
34+
// Remote attestation type.
35+
//
36+
// | Type | Value |
37+
// |-----------------|-------|
38+
// | IAS | 1 |
39+
// | DCAP | 2 |
40+
// | ZKDCAPRisc0 | 3 |
41+
// | MockZKDCAPRisc0 | 4 |
2542
uint32 ra_type = 3;
2643
}
2744

45+
// Response for getting the attested enclave keys.
2846
message QueryAvailableEnclaveKeysResponse {
2947
repeated EnclaveKeyInfo keys = 1;
3048
}
3149

50+
// Enclave key information contains the RA type specific information.
3251
message EnclaveKeyInfo {
3352
oneof key_info {
3453
IASEnclaveKeyInfo ias = 1;
@@ -37,6 +56,7 @@ message EnclaveKeyInfo {
3756
}
3857
}
3958

59+
// Enclave key information with IAS report.
4060
message IASEnclaveKeyInfo {
4161
bytes enclave_key_address = 1;
4262
string report = 2;
@@ -45,6 +65,7 @@ message IASEnclaveKeyInfo {
4565
bytes signing_cert = 5;
4666
}
4767

68+
// Enclave key information with DCAP quote and supplemental data.
4869
message DCAPEnclaveKeyInfo {
4970
bytes enclave_key_address = 1;
5071
bytes quote = 2;
@@ -55,29 +76,34 @@ message DCAPEnclaveKeyInfo {
5576
QVCollateral collateral = 7;
5677
}
5778

79+
// Validity Period
5880
message Validity {
5981
uint64 not_before = 1;
6082
uint64 not_after = 2;
6183
}
6284

85+
// Enclave key information with zkDCAP proof and DCAP attestation info.
6386
message ZKDCAPEnclaveKeyInfo {
6487
DCAPEnclaveKeyInfo dcap = 1;
6588
ZKVMProof zkp = 2;
6689
}
6790

91+
// ZKVM proof
6892
message ZKVMProof {
6993
oneof proof {
7094
Risc0ZKVMProof risc0 = 1;
7195
}
7296
}
7397

98+
// RISC Zero zkVM proof for zkDCAP
7499
message Risc0ZKVMProof {
75100
bytes image_id = 1;
76101
bytes selector = 2;
77102
bytes seal = 3;
78103
bytes output = 4;
79104
}
80105

106+
// Collateral information for the DCAP quote verification.
81107
message QVCollateral {
82108
string tcb_info_json = 1;
83109
string qe_identity_json = 2;
@@ -87,10 +113,12 @@ message QVCollateral {
87113
bytes sgx_pck_crl_der = 6;
88114
}
89115

116+
// Request for getting the enclave key information.
90117
message QueryEnclaveKeyRequest {
91118
bytes enclave_key_address = 1;
92119
}
93120

121+
// Response for getting the enclave key information.
94122
message QueryEnclaveKeyResponse {
95123
EnclaveKeyInfo key = 1;
96124
}

proto/src/descriptor.bin

1.23 KB
Binary file not shown.

proto/src/prost/lcp.service.enclave.v1.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
/// Request for getting the enclave information.
12
#[derive(::serde::Serialize, ::serde::Deserialize)]
23
#[allow(clippy::derive_partial_eq_without_eq)]
34
#[derive(Clone, PartialEq, ::prost::Message)]
45
pub struct QueryEnclaveInfoRequest {}
6+
/// Response for getting the enclave information.
57
#[derive(::serde::Serialize, ::serde::Deserialize)]
68
#[allow(clippy::derive_partial_eq_without_eq)]
79
#[derive(Clone, PartialEq, ::prost::Message)]
@@ -11,24 +13,37 @@ pub struct QueryEnclaveInfoResponse {
1113
#[prost(bool, tag = "2")]
1214
pub enclave_debug: bool,
1315
}
16+
/// Request for getting the attested enclave keys corresponding to the specified MRENCLAVE.
1417
#[derive(::serde::Serialize, ::serde::Deserialize)]
1518
#[allow(clippy::derive_partial_eq_without_eq)]
1619
#[derive(Clone, PartialEq, ::prost::Message)]
1720
pub struct QueryAvailableEnclaveKeysRequest {
21+
/// MRENCLAVE of the enclave that generates the EK.
1822
#[prost(bytes = "vec", tag = "1")]
1923
pub mrenclave: ::prost::alloc::vec::Vec<u8>,
24+
/// Debug flag of the enclave that generates the EK.
2025
#[prost(bool, tag = "2")]
2126
pub enclave_debug: bool,
27+
/// Remote attestation type.
28+
///
29+
/// | Type | Value |
30+
/// |-----------------|-------|
31+
/// | IAS | 1 |
32+
/// | DCAP | 2 |
33+
/// | ZKDCAPRisc0 | 3 |
34+
/// | MockZKDCAPRisc0 | 4 |
2235
#[prost(uint32, tag = "3")]
2336
pub ra_type: u32,
2437
}
38+
/// Response for getting the attested enclave keys.
2539
#[derive(::serde::Serialize, ::serde::Deserialize)]
2640
#[allow(clippy::derive_partial_eq_without_eq)]
2741
#[derive(Clone, PartialEq, ::prost::Message)]
2842
pub struct QueryAvailableEnclaveKeysResponse {
2943
#[prost(message, repeated, tag = "1")]
3044
pub keys: ::prost::alloc::vec::Vec<EnclaveKeyInfo>,
3145
}
46+
/// Enclave key information contains the RA type specific information.
3247
#[derive(::serde::Serialize, ::serde::Deserialize)]
3348
#[allow(clippy::derive_partial_eq_without_eq)]
3449
#[derive(Clone, PartialEq, ::prost::Message)]
@@ -50,6 +65,7 @@ pub mod enclave_key_info {
5065
Zkdcap(super::ZkdcapEnclaveKeyInfo),
5166
}
5267
}
68+
/// Enclave key information with IAS report.
5369
#[derive(::serde::Serialize, ::serde::Deserialize)]
5470
#[allow(clippy::derive_partial_eq_without_eq)]
5571
#[derive(Clone, PartialEq, ::prost::Message)]
@@ -65,6 +81,7 @@ pub struct IasEnclaveKeyInfo {
6581
#[prost(bytes = "vec", tag = "5")]
6682
pub signing_cert: ::prost::alloc::vec::Vec<u8>,
6783
}
84+
/// Enclave key information with DCAP quote and supplemental data.
6885
#[derive(::serde::Serialize, ::serde::Deserialize)]
6986
#[allow(clippy::derive_partial_eq_without_eq)]
7087
#[derive(Clone, PartialEq, ::prost::Message)]
@@ -84,6 +101,7 @@ pub struct DcapEnclaveKeyInfo {
84101
#[prost(message, optional, tag = "7")]
85102
pub collateral: ::core::option::Option<QvCollateral>,
86103
}
104+
/// Validity Period
87105
#[derive(::serde::Serialize, ::serde::Deserialize)]
88106
#[allow(clippy::derive_partial_eq_without_eq)]
89107
#[derive(Clone, PartialEq, ::prost::Message)]
@@ -93,6 +111,7 @@ pub struct Validity {
93111
#[prost(uint64, tag = "2")]
94112
pub not_after: u64,
95113
}
114+
/// Enclave key information with zkDCAP proof and DCAP attestation info.
96115
#[derive(::serde::Serialize, ::serde::Deserialize)]
97116
#[allow(clippy::derive_partial_eq_without_eq)]
98117
#[derive(Clone, PartialEq, ::prost::Message)]
@@ -102,6 +121,7 @@ pub struct ZkdcapEnclaveKeyInfo {
102121
#[prost(message, optional, tag = "2")]
103122
pub zkp: ::core::option::Option<ZkvmProof>,
104123
}
124+
/// ZKVM proof
105125
#[derive(::serde::Serialize, ::serde::Deserialize)]
106126
#[allow(clippy::derive_partial_eq_without_eq)]
107127
#[derive(Clone, PartialEq, ::prost::Message)]
@@ -119,6 +139,7 @@ pub mod zkvm_proof {
119139
Risc0(super::Risc0ZkvmProof),
120140
}
121141
}
142+
/// RISC Zero zkVM proof for zkDCAP
122143
#[derive(::serde::Serialize, ::serde::Deserialize)]
123144
#[allow(clippy::derive_partial_eq_without_eq)]
124145
#[derive(Clone, PartialEq, ::prost::Message)]
@@ -132,6 +153,7 @@ pub struct Risc0ZkvmProof {
132153
#[prost(bytes = "vec", tag = "4")]
133154
pub output: ::prost::alloc::vec::Vec<u8>,
134155
}
156+
/// Collateral information for the DCAP quote verification.
135157
#[derive(::serde::Serialize, ::serde::Deserialize)]
136158
#[allow(clippy::derive_partial_eq_without_eq)]
137159
#[derive(Clone, PartialEq, ::prost::Message)]
@@ -149,13 +171,15 @@ pub struct QvCollateral {
149171
#[prost(bytes = "vec", tag = "6")]
150172
pub sgx_pck_crl_der: ::prost::alloc::vec::Vec<u8>,
151173
}
174+
/// Request for getting the enclave key information.
152175
#[derive(::serde::Serialize, ::serde::Deserialize)]
153176
#[allow(clippy::derive_partial_eq_without_eq)]
154177
#[derive(Clone, PartialEq, ::prost::Message)]
155178
pub struct QueryEnclaveKeyRequest {
156179
#[prost(bytes = "vec", tag = "1")]
157180
pub enclave_key_address: ::prost::alloc::vec::Vec<u8>,
158181
}
182+
/// Response for getting the enclave key information.
159183
#[derive(::serde::Serialize, ::serde::Deserialize)]
160184
#[allow(clippy::derive_partial_eq_without_eq)]
161185
#[derive(Clone, PartialEq, ::prost::Message)]
@@ -233,6 +257,7 @@ pub mod query_client {
233257
self.inner = self.inner.accept_compressed(encoding);
234258
self
235259
}
260+
/// Get the enclave information loaded in the service.
236261
pub async fn enclave_info(
237262
&mut self,
238263
request: impl tonic::IntoRequest<super::QueryEnclaveInfoRequest>,
@@ -252,6 +277,8 @@ pub mod query_client {
252277
);
253278
self.inner.unary(request.into_request(), path, codec).await
254279
}
280+
/// Get the available enclave keys for matching the
281+
/// specified MRENCLAVE and debug flag and RA type.
255282
pub async fn available_enclave_keys(
256283
&mut self,
257284
request: impl tonic::IntoRequest<super::QueryAvailableEnclaveKeysRequest>,
@@ -274,6 +301,7 @@ pub mod query_client {
274301
);
275302
self.inner.unary(request.into_request(), path, codec).await
276303
}
304+
/// Get the enclave key information for the specified enclave key address.
277305
pub async fn enclave_key(
278306
&mut self,
279307
request: impl tonic::IntoRequest<super::QueryEnclaveKeyRequest>,
@@ -303,17 +331,21 @@ pub mod query_server {
303331
/// Generated trait containing gRPC methods that should be implemented for use with QueryServer.
304332
#[async_trait]
305333
pub trait Query: Send + Sync + 'static {
334+
/// Get the enclave information loaded in the service.
306335
async fn enclave_info(
307336
&self,
308337
request: tonic::Request<super::QueryEnclaveInfoRequest>,
309338
) -> Result<tonic::Response<super::QueryEnclaveInfoResponse>, tonic::Status>;
339+
/// Get the available enclave keys for matching the
340+
/// specified MRENCLAVE and debug flag and RA type.
310341
async fn available_enclave_keys(
311342
&self,
312343
request: tonic::Request<super::QueryAvailableEnclaveKeysRequest>,
313344
) -> Result<
314345
tonic::Response<super::QueryAvailableEnclaveKeysResponse>,
315346
tonic::Status,
316347
>;
348+
/// Get the enclave key information for the specified enclave key address.
317349
async fn enclave_key(
318350
&self,
319351
request: tonic::Request<super::QueryEnclaveKeyRequest>,

0 commit comments

Comments
 (0)