|
1 | 1 | #[derive(::serde::Serialize, ::serde::Deserialize)] |
2 | 2 | #[allow(clippy::derive_partial_eq_without_eq)] |
3 | 3 | #[derive(Clone, PartialEq, ::prost::Message)] |
| 4 | +pub struct QueryEnclaveInfoRequest {} |
| 5 | +#[derive(::serde::Serialize, ::serde::Deserialize)] |
| 6 | +#[allow(clippy::derive_partial_eq_without_eq)] |
| 7 | +#[derive(Clone, PartialEq, ::prost::Message)] |
| 8 | +pub struct QueryEnclaveInfoResponse { |
| 9 | + #[prost(bytes = "vec", tag = "1")] |
| 10 | + pub mrenclave: ::prost::alloc::vec::Vec<u8>, |
| 11 | + #[prost(bool, tag = "2")] |
| 12 | + pub enclave_debug: bool, |
| 13 | +} |
| 14 | +#[derive(::serde::Serialize, ::serde::Deserialize)] |
| 15 | +#[allow(clippy::derive_partial_eq_without_eq)] |
| 16 | +#[derive(Clone, PartialEq, ::prost::Message)] |
4 | 17 | pub struct QueryAvailableEnclaveKeysRequest { |
5 | 18 | #[prost(bytes = "vec", tag = "1")] |
6 | 19 | pub mrenclave: ::prost::alloc::vec::Vec<u8>, |
@@ -209,6 +222,25 @@ pub mod query_client { |
209 | 222 | self.inner = self.inner.accept_compressed(encoding); |
210 | 223 | self |
211 | 224 | } |
| 225 | + pub async fn enclave_info( |
| 226 | + &mut self, |
| 227 | + request: impl tonic::IntoRequest<super::QueryEnclaveInfoRequest>, |
| 228 | + ) -> Result<tonic::Response<super::QueryEnclaveInfoResponse>, tonic::Status> { |
| 229 | + self.inner |
| 230 | + .ready() |
| 231 | + .await |
| 232 | + .map_err(|e| { |
| 233 | + tonic::Status::new( |
| 234 | + tonic::Code::Unknown, |
| 235 | + format!("Service was not ready: {}", e.into()), |
| 236 | + ) |
| 237 | + })?; |
| 238 | + let codec = tonic::codec::ProstCodec::default(); |
| 239 | + let path = http::uri::PathAndQuery::from_static( |
| 240 | + "/lcp.service.enclave.v1.Query/EnclaveInfo", |
| 241 | + ); |
| 242 | + self.inner.unary(request.into_request(), path, codec).await |
| 243 | + } |
212 | 244 | pub async fn available_enclave_keys( |
213 | 245 | &mut self, |
214 | 246 | request: impl tonic::IntoRequest<super::QueryAvailableEnclaveKeysRequest>, |
@@ -260,6 +292,10 @@ pub mod query_server { |
260 | 292 | /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. |
261 | 293 | #[async_trait] |
262 | 294 | pub trait Query: Send + Sync + 'static { |
| 295 | + async fn enclave_info( |
| 296 | + &self, |
| 297 | + request: tonic::Request<super::QueryEnclaveInfoRequest>, |
| 298 | + ) -> Result<tonic::Response<super::QueryEnclaveInfoResponse>, tonic::Status>; |
263 | 299 | async fn available_enclave_keys( |
264 | 300 | &self, |
265 | 301 | request: tonic::Request<super::QueryAvailableEnclaveKeysRequest>, |
@@ -331,6 +367,46 @@ pub mod query_server { |
331 | 367 | fn call(&mut self, req: http::Request<B>) -> Self::Future { |
332 | 368 | let inner = self.inner.clone(); |
333 | 369 | match req.uri().path() { |
| 370 | + "/lcp.service.enclave.v1.Query/EnclaveInfo" => { |
| 371 | + #[allow(non_camel_case_types)] |
| 372 | + struct EnclaveInfoSvc<T: Query>(pub Arc<T>); |
| 373 | + impl< |
| 374 | + T: Query, |
| 375 | + > tonic::server::UnaryService<super::QueryEnclaveInfoRequest> |
| 376 | + for EnclaveInfoSvc<T> { |
| 377 | + type Response = super::QueryEnclaveInfoResponse; |
| 378 | + type Future = BoxFuture< |
| 379 | + tonic::Response<Self::Response>, |
| 380 | + tonic::Status, |
| 381 | + >; |
| 382 | + fn call( |
| 383 | + &mut self, |
| 384 | + request: tonic::Request<super::QueryEnclaveInfoRequest>, |
| 385 | + ) -> Self::Future { |
| 386 | + let inner = self.0.clone(); |
| 387 | + let fut = async move { |
| 388 | + (*inner).enclave_info(request).await |
| 389 | + }; |
| 390 | + Box::pin(fut) |
| 391 | + } |
| 392 | + } |
| 393 | + let accept_compression_encodings = self.accept_compression_encodings; |
| 394 | + let send_compression_encodings = self.send_compression_encodings; |
| 395 | + let inner = self.inner.clone(); |
| 396 | + let fut = async move { |
| 397 | + let inner = inner.0; |
| 398 | + let method = EnclaveInfoSvc(inner); |
| 399 | + let codec = tonic::codec::ProstCodec::default(); |
| 400 | + let mut grpc = tonic::server::Grpc::new(codec) |
| 401 | + .apply_compression_config( |
| 402 | + accept_compression_encodings, |
| 403 | + send_compression_encodings, |
| 404 | + ); |
| 405 | + let res = grpc.unary(method, req).await; |
| 406 | + Ok(res) |
| 407 | + }; |
| 408 | + Box::pin(fut) |
| 409 | + } |
334 | 410 | "/lcp.service.enclave.v1.Query/AvailableEnclaveKeys" => { |
335 | 411 | #[allow(non_camel_case_types)] |
336 | 412 | struct AvailableEnclaveKeysSvc<T: Query>(pub Arc<T>); |
|
0 commit comments