Skip to content

Commit 9ac342f

Browse files
committed
ci: fix ci environment issue
1 parent 089cc8c commit 9ac342f

File tree

7 files changed

+138
-67
lines changed

7 files changed

+138
-67
lines changed

src/client/builder.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@ impl ClientBuilder<HasUrl, HasCredentials> {
595595
.connect_timeout(timeout);
596596

597597
// Configure TLS if needed
598+
#[cfg(feature = "rustls")]
598599
if parsed_url.scheme() == "https" {
599600
builder = builder.use_rustls_tls();
600601
}
@@ -702,6 +703,7 @@ impl ClientBuilder<HasUrl, HasCredentials> {
702703
.connect_timeout(timeout);
703704

704705
// Configure TLS if needed
706+
#[cfg(feature = "rustls")]
705707
if parsed_url.scheme() == "https" {
706708
builder = builder.use_rustls_tls();
707709
}

src/client/inner.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! Internal client implementation.
22
3+
#[cfg(any(feature = "grpc", feature = "rest"))]
34
use std::sync::Arc;
45
use std::time::Duration;
56

@@ -12,6 +13,7 @@ use crate::auth::Credentials;
1213
use crate::config::{CacheConfig, DegradationConfig, RetryConfig, TlsConfig};
1314
#[cfg(feature = "rest")]
1415
use crate::error::{Error, ErrorKind};
16+
#[cfg(any(feature = "grpc", feature = "rest"))]
1517
use crate::transport::TransportClient;
1618

1719
use super::health::ShutdownGuard;

src/control/account.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ impl AccountClient {
5050
self.client.inner().control_get("/control/v1/account").await
5151
}
5252

53+
/// Gets the current user's account information.
54+
///
55+
/// Requires the `rest` feature to be enabled.
5356
#[cfg(not(feature = "rest"))]
5457
pub async fn get(&self) -> Result<Account, Error> {
5558
Err(Error::configuration(

src/transport/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@ pub use traits::{
4848
};
4949

5050
// Internal re-exports (used when transport is integrated with client)
51+
#[cfg(feature = "rest")]
5152
pub(crate) use traits::{
5253
CheckRequest as TransportCheckRequest, SimulateRequest as TransportSimulateRequest,
53-
TransportClient, WriteRequest as TransportWriteRequest,
54+
WriteRequest as TransportWriteRequest,
5455
};
56+
pub(crate) use traits::TransportClient;
5557

5658
// Re-export REST transport
5759
#[cfg(feature = "rest")]

src/transport/proto/inferadb.v1.rs

Lines changed: 126 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -546,10 +546,10 @@ pub mod inferadb_service_client {
546546
dead_code,
547547
missing_docs,
548548
clippy::wildcard_imports,
549-
clippy::let_unit_value
549+
clippy::let_unit_value,
550550
)]
551-
use tonic::codegen::http::Uri;
552551
use tonic::codegen::*;
552+
use tonic::codegen::http::Uri;
553553
/// The main Infera authorization service
554554
#[derive(Debug, Clone)]
555555
pub struct InferadbServiceClient<T> {
@@ -594,8 +594,9 @@ pub mod inferadb_service_client {
594594
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
595595
>,
596596
>,
597-
<T as tonic::codegen::Service<http::Request<tonic::body::Body>>>::Error:
598-
Into<StdError> + std::marker::Send + std::marker::Sync,
597+
<T as tonic::codegen::Service<
598+
http::Request<tonic::body::Body>,
599+
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
599600
{
600601
InferadbServiceClient::new(InterceptedService::new(inner, interceptor))
601602
}
@@ -639,12 +640,18 @@ pub mod inferadb_service_client {
639640
tonic::Response<tonic::codec::Streaming<super::EvaluateResponse>>,
640641
tonic::Status,
641642
> {
642-
self.inner.ready().await.map_err(|e| {
643-
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
644-
})?;
643+
self.inner
644+
.ready()
645+
.await
646+
.map_err(|e| {
647+
tonic::Status::unknown(
648+
format!("Service was not ready: {}", e.into()),
649+
)
650+
})?;
645651
let codec = tonic_prost::ProstCodec::default();
646-
let path =
647-
http::uri::PathAndQuery::from_static("/inferadb.v1.InferadbService/Evaluate");
652+
let path = http::uri::PathAndQuery::from_static(
653+
"/inferadb.v1.InferadbService/Evaluate",
654+
);
648655
let mut req = request.into_streaming_request();
649656
req.extensions_mut()
650657
.insert(GrpcMethod::new("inferadb.v1.InferadbService", "Evaluate"));
@@ -658,11 +665,18 @@ pub mod inferadb_service_client {
658665
tonic::Response<tonic::codec::Streaming<super::ExpandResponse>>,
659666
tonic::Status,
660667
> {
661-
self.inner.ready().await.map_err(|e| {
662-
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
663-
})?;
668+
self.inner
669+
.ready()
670+
.await
671+
.map_err(|e| {
672+
tonic::Status::unknown(
673+
format!("Service was not ready: {}", e.into()),
674+
)
675+
})?;
664676
let codec = tonic_prost::ProstCodec::default();
665-
let path = http::uri::PathAndQuery::from_static("/inferadb.v1.InferadbService/Expand");
677+
let path = http::uri::PathAndQuery::from_static(
678+
"/inferadb.v1.InferadbService/Expand",
679+
);
666680
let mut req = request.into_request();
667681
req.extensions_mut()
668682
.insert(GrpcMethod::new("inferadb.v1.InferadbService", "Expand"));
@@ -673,49 +687,66 @@ pub mod inferadb_service_client {
673687
&mut self,
674688
request: impl tonic::IntoStreamingRequest<Message = super::WriteRequest>,
675689
) -> std::result::Result<tonic::Response<super::WriteResponse>, tonic::Status> {
676-
self.inner.ready().await.map_err(|e| {
677-
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
678-
})?;
690+
self.inner
691+
.ready()
692+
.await
693+
.map_err(|e| {
694+
tonic::Status::unknown(
695+
format!("Service was not ready: {}", e.into()),
696+
)
697+
})?;
679698
let codec = tonic_prost::ProstCodec::default();
680699
let path = http::uri::PathAndQuery::from_static(
681700
"/inferadb.v1.InferadbService/WriteRelationships",
682701
);
683702
let mut req = request.into_streaming_request();
684-
req.extensions_mut().insert(GrpcMethod::new(
685-
"inferadb.v1.InferadbService",
686-
"WriteRelationships",
687-
));
703+
req.extensions_mut()
704+
.insert(
705+
GrpcMethod::new("inferadb.v1.InferadbService", "WriteRelationships"),
706+
);
688707
self.inner.client_streaming(req, path, codec).await
689708
}
690709
/// Delete relationships from the store
691710
pub async fn delete_relationships(
692711
&mut self,
693712
request: impl tonic::IntoStreamingRequest<Message = super::DeleteRequest>,
694713
) -> std::result::Result<tonic::Response<super::DeleteResponse>, tonic::Status> {
695-
self.inner.ready().await.map_err(|e| {
696-
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
697-
})?;
714+
self.inner
715+
.ready()
716+
.await
717+
.map_err(|e| {
718+
tonic::Status::unknown(
719+
format!("Service was not ready: {}", e.into()),
720+
)
721+
})?;
698722
let codec = tonic_prost::ProstCodec::default();
699723
let path = http::uri::PathAndQuery::from_static(
700724
"/inferadb.v1.InferadbService/DeleteRelationships",
701725
);
702726
let mut req = request.into_streaming_request();
703-
req.extensions_mut().insert(GrpcMethod::new(
704-
"inferadb.v1.InferadbService",
705-
"DeleteRelationships",
706-
));
727+
req.extensions_mut()
728+
.insert(
729+
GrpcMethod::new("inferadb.v1.InferadbService", "DeleteRelationships"),
730+
);
707731
self.inner.client_streaming(req, path, codec).await
708732
}
709733
/// Health check
710734
pub async fn health(
711735
&mut self,
712736
request: impl tonic::IntoRequest<super::HealthRequest>,
713737
) -> std::result::Result<tonic::Response<super::HealthResponse>, tonic::Status> {
714-
self.inner.ready().await.map_err(|e| {
715-
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
716-
})?;
738+
self.inner
739+
.ready()
740+
.await
741+
.map_err(|e| {
742+
tonic::Status::unknown(
743+
format!("Service was not ready: {}", e.into()),
744+
)
745+
})?;
717746
let codec = tonic_prost::ProstCodec::default();
718-
let path = http::uri::PathAndQuery::from_static("/inferadb.v1.InferadbService/Health");
747+
let path = http::uri::PathAndQuery::from_static(
748+
"/inferadb.v1.InferadbService/Health",
749+
);
719750
let mut req = request.into_request();
720751
req.extensions_mut()
721752
.insert(GrpcMethod::new("inferadb.v1.InferadbService", "Health"));
@@ -729,17 +760,21 @@ pub mod inferadb_service_client {
729760
tonic::Response<tonic::codec::Streaming<super::ListResourcesResponse>>,
730761
tonic::Status,
731762
> {
732-
self.inner.ready().await.map_err(|e| {
733-
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
734-
})?;
763+
self.inner
764+
.ready()
765+
.await
766+
.map_err(|e| {
767+
tonic::Status::unknown(
768+
format!("Service was not ready: {}", e.into()),
769+
)
770+
})?;
735771
let codec = tonic_prost::ProstCodec::default();
736-
let path =
737-
http::uri::PathAndQuery::from_static("/inferadb.v1.InferadbService/ListResources");
772+
let path = http::uri::PathAndQuery::from_static(
773+
"/inferadb.v1.InferadbService/ListResources",
774+
);
738775
let mut req = request.into_request();
739-
req.extensions_mut().insert(GrpcMethod::new(
740-
"inferadb.v1.InferadbService",
741-
"ListResources",
742-
));
776+
req.extensions_mut()
777+
.insert(GrpcMethod::new("inferadb.v1.InferadbService", "ListResources"));
743778
self.inner.server_streaming(req, path, codec).await
744779
}
745780
/// List relationships (relationships) with optional filtering
@@ -750,18 +785,23 @@ pub mod inferadb_service_client {
750785
tonic::Response<tonic::codec::Streaming<super::ListRelationshipsResponse>>,
751786
tonic::Status,
752787
> {
753-
self.inner.ready().await.map_err(|e| {
754-
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
755-
})?;
788+
self.inner
789+
.ready()
790+
.await
791+
.map_err(|e| {
792+
tonic::Status::unknown(
793+
format!("Service was not ready: {}", e.into()),
794+
)
795+
})?;
756796
let codec = tonic_prost::ProstCodec::default();
757797
let path = http::uri::PathAndQuery::from_static(
758798
"/inferadb.v1.InferadbService/ListRelationships",
759799
);
760800
let mut req = request.into_request();
761-
req.extensions_mut().insert(GrpcMethod::new(
762-
"inferadb.v1.InferadbService",
763-
"ListRelationships",
764-
));
801+
req.extensions_mut()
802+
.insert(
803+
GrpcMethod::new("inferadb.v1.InferadbService", "ListRelationships"),
804+
);
765805
self.inner.server_streaming(req, path, codec).await
766806
}
767807
/// List subjects that have a specific relation to a resource
@@ -772,17 +812,21 @@ pub mod inferadb_service_client {
772812
tonic::Response<tonic::codec::Streaming<super::ListSubjectsResponse>>,
773813
tonic::Status,
774814
> {
775-
self.inner.ready().await.map_err(|e| {
776-
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
777-
})?;
815+
self.inner
816+
.ready()
817+
.await
818+
.map_err(|e| {
819+
tonic::Status::unknown(
820+
format!("Service was not ready: {}", e.into()),
821+
)
822+
})?;
778823
let codec = tonic_prost::ProstCodec::default();
779-
let path =
780-
http::uri::PathAndQuery::from_static("/inferadb.v1.InferadbService/ListSubjects");
824+
let path = http::uri::PathAndQuery::from_static(
825+
"/inferadb.v1.InferadbService/ListSubjects",
826+
);
781827
let mut req = request.into_request();
782-
req.extensions_mut().insert(GrpcMethod::new(
783-
"inferadb.v1.InferadbService",
784-
"ListSubjects",
785-
));
828+
req.extensions_mut()
829+
.insert(GrpcMethod::new("inferadb.v1.InferadbService", "ListSubjects"));
786830
self.inner.server_streaming(req, path, codec).await
787831
}
788832
/// Watch for real-time relationship changes
@@ -793,11 +837,18 @@ pub mod inferadb_service_client {
793837
tonic::Response<tonic::codec::Streaming<super::WatchResponse>>,
794838
tonic::Status,
795839
> {
796-
self.inner.ready().await.map_err(|e| {
797-
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
798-
})?;
840+
self.inner
841+
.ready()
842+
.await
843+
.map_err(|e| {
844+
tonic::Status::unknown(
845+
format!("Service was not ready: {}", e.into()),
846+
)
847+
})?;
799848
let codec = tonic_prost::ProstCodec::default();
800-
let path = http::uri::PathAndQuery::from_static("/inferadb.v1.InferadbService/Watch");
849+
let path = http::uri::PathAndQuery::from_static(
850+
"/inferadb.v1.InferadbService/Watch",
851+
);
801852
let mut req = request.into_request();
802853
req.extensions_mut()
803854
.insert(GrpcMethod::new("inferadb.v1.InferadbService", "Watch"));
@@ -807,13 +858,22 @@ pub mod inferadb_service_client {
807858
pub async fn simulate(
808859
&mut self,
809860
request: impl tonic::IntoRequest<super::SimulateRequest>,
810-
) -> std::result::Result<tonic::Response<super::SimulateResponse>, tonic::Status> {
811-
self.inner.ready().await.map_err(|e| {
812-
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
813-
})?;
861+
) -> std::result::Result<
862+
tonic::Response<super::SimulateResponse>,
863+
tonic::Status,
864+
> {
865+
self.inner
866+
.ready()
867+
.await
868+
.map_err(|e| {
869+
tonic::Status::unknown(
870+
format!("Service was not ready: {}", e.into()),
871+
)
872+
})?;
814873
let codec = tonic_prost::ProstCodec::default();
815-
let path =
816-
http::uri::PathAndQuery::from_static("/inferadb.v1.InferadbService/Simulate");
874+
let path = http::uri::PathAndQuery::from_static(
875+
"/inferadb.v1.InferadbService/Simulate",
876+
);
817877
let mut req = request.into_request();
818878
req.extensions_mut()
819879
.insert(GrpcMethod::new("inferadb.v1.InferadbService", "Simulate"));

src/vault/client.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use std::borrow::Cow;
77
use std::future::Future;
88
use std::pin::Pin;
9+
#[cfg(feature = "rest")]
910
use std::sync::Arc;
1011

1112
use crate::client::Client;

src/vault/watch.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ impl ReconnectConfig {
513513
/// .await?;
514514
/// ```
515515
pub struct WatchBuilder {
516+
#[cfg_attr(not(feature = "rest"), allow(dead_code))]
516517
client: Client,
517518
organization_id: String,
518519
vault_id: String,

0 commit comments

Comments
 (0)