Skip to content

Commit 52c0651

Browse files
authored
feat: allow use of reqwest without ring provider (#155)
Signed-off-by: Mauro Sardara <[email protected]>
1 parent 09474d4 commit 52c0651

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

crates/rmcp/Cargo.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ base64 = { version = "0.21", optional = true }
3737
reqwest = { version = "0.12", default-features = false, features = [
3838
"json",
3939
"stream",
40-
"rustls-tls",
4140
], optional = true }
4241
sse-stream = { version = "0.1.3", optional = true }
4342
url = { version = "2.4", optional = true }
@@ -62,7 +61,9 @@ default = ["base64", "macros", "server"]
6261
client = []
6362
server = ["transport-async-rw", "dep:schemars"]
6463
macros = ["dep:rmcp-macros", "dep:paste"]
65-
transport-sse = ["dep:reqwest", "dep:sse-stream", "dep:url"]
64+
__transport-sse = ["dep:reqwest", "dep:sse-stream", "dep:url"]
65+
transport-sse = ["__transport-sse", "reqwest?/rustls-tls"]
66+
transport-sse-tls-no-provider = ["__transport-sse", "reqwest?/rustls-tls-no-provider"]
6667
transport-async-rw = ["tokio/io-util", "tokio-util/codec"]
6768
transport-io = ["transport-async-rw", "tokio/io-std"]
6869
transport-child-process = ["transport-async-rw", "tokio/process"]
@@ -74,7 +75,9 @@ transport-sse-server = [
7475
]
7576
# transport-ws = ["transport-io", "dep:tokio-tungstenite"]
7677
tower = ["dep:tower-service"]
77-
auth = ["dep:oauth2", "dep:reqwest", "dep:url"]
78+
__auth = ["dep:oauth2", "dep:reqwest", "dep:url"]
79+
auth = ["__auth", "reqwest?/rustls-tls"]
80+
auth-tls-no-provider = ["auth", "reqwest?/rustls-tls-no-provider"]
7881

7982
[dev-dependencies]
8083
tokio = { version = "1", features = ["full"] }

crates/rmcp/src/transport.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ pub mod io;
5151
#[cfg(feature = "transport-io")]
5252
pub use io::stdio;
5353

54-
#[cfg(feature = "transport-sse")]
54+
#[cfg(feature = "__transport-sse")]
5555
pub mod sse;
56-
#[cfg(feature = "transport-sse")]
56+
#[cfg(feature = "__transport-sse")]
5757
pub use sse::SseTransport;
5858

59-
#[cfg(all(feature = "transport-sse", feature = "auth"))]
59+
#[cfg(all(feature = "__transport-sse", feature = "__auth"))]
6060
pub mod sse_auth;
61-
#[cfg(all(feature = "transport-sse", feature = "auth"))]
61+
#[cfg(all(feature = "__transport-sse", feature = "__auth"))]
6262
pub use sse_auth::{AuthorizedSseClient, create_authorized_transport};
6363

6464
// #[cfg(feature = "tower")]
@@ -69,9 +69,9 @@ pub mod sse_server;
6969
#[cfg(feature = "transport-sse-server")]
7070
pub use sse_server::SseServer;
7171

72-
#[cfg(feature = "auth")]
72+
#[cfg(feature = "__auth")]
7373
pub mod auth;
74-
#[cfg(feature = "auth")]
74+
#[cfg(feature = "__auth")]
7575
pub use auth::{AuthError, AuthorizationManager, AuthorizationSession, AuthorizedHttpClient};
7676

7777
// #[cfg(feature = "transport-ws")]

0 commit comments

Comments
 (0)