Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ For many cases you need to manage several service in a collection, you can call
let service = service.into_dyn();
```

### OAuth Support

See [docs/OAUTH_SUPPORT.md](docs/OAUTH_SUPPORT.md) for details.

### Examples

See [examples](examples/README.md)
Expand Down
6 changes: 6 additions & 0 deletions crates/rmcp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ tracing = { version = "0.1" }
tokio-util = { version = "0.7" }
pin-project-lite = "0.2"
paste = { version = "1", optional = true }

# oauth2 support
oauth2 = { version = "5.0", optional = true }

# for auto generate schema
schemars = { version = "0.8", optional = true }

Expand Down Expand Up @@ -70,6 +74,8 @@ transport-sse-server = [
]
# transport-ws = ["transport-io", "dep:tokio-tungstenite"]
tower = ["dep:tower-service"]
auth = ["dep:oauth2", "dep:reqwest", "dep:url"]

[dev-dependencies]
tokio = { version = "1", features = ["full"] }
schemars = { version = "0.8" }
Expand Down
10 changes: 10 additions & 0 deletions crates/rmcp/src/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ pub mod sse;
#[cfg(feature = "transport-sse")]
pub use sse::SseTransport;

#[cfg(all(feature = "transport-sse", feature = "auth"))]
pub mod sse_auth;
#[cfg(all(feature = "transport-sse", feature = "auth"))]
pub use sse_auth::{AuthorizedSseClient, create_authorized_transport};

// #[cfg(feature = "tower")]
// pub mod tower;

Expand All @@ -64,6 +69,11 @@ pub mod sse_server;
#[cfg(feature = "transport-sse-server")]
pub use sse_server::SseServer;

#[cfg(feature = "auth")]
pub mod auth;
#[cfg(feature = "auth")]
pub use auth::{AuthError, AuthorizationManager, AuthorizationSession, AuthorizedHttpClient};

// #[cfg(feature = "transport-ws")]
// pub mod ws;

Expand Down
Loading
Loading