Skip to content

Commit 61845d6

Browse files
wdawsonfizy069
andauthored
11-25-2025 compliant Auth (#651)
* fix: correct discovery for AS metadata * fix: add commitlint to dev container * feat: add RFC 8707 support for resource parameter * feat: pkce method verification * feat(auth): implement SEP-835 scope handling and 403 upgrade flow - add WWWAuthenticateParams for parsing scope and resource_metadata from headers - add ScopeUpgradeConfig and scope tracking in AuthorizationManager - add InsufficientScopeError and 403 handling in streamable HTTP client - add scope union computation for progressive authorization - export new public types: AuthClient, ScopeUpgradeConfig, WWWAuthenticateParams Co-authored-by: fizy069 <fizy069@users.noreply.github.com> * fix: reorg auth tests * feat: add error to www-authenticate header parsing * feat: consider protected resource metadata in scope selection * fix: reorganize auth tests * feat: add examples and docs for updated auth --------- Co-authored-by: fizy069 <fizy069@users.noreply.github.com>
1 parent a1c66a8 commit 61845d6

File tree

8 files changed

+996
-256
lines changed

8 files changed

+996
-256
lines changed

.devcontainer/devcontainer.json

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
22
// README at: https://github.com/devcontainers/templates/tree/main/src/rust
33
{
4-
"name": "Rust",
5-
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"image": "mcr.microsoft.com/devcontainers/rust:1-1-bullseye",
7-
"features": {
8-
"ghcr.io/devcontainers/features/node:1": {},
9-
"ghcr.io/devcontainers/features/python:1": {
10-
"version": "3.10",
11-
"toolsToInstall": "uv"
12-
}
13-
},
14-
// Configure tool-specific properties.
15-
"customizations": {
16-
"vscode": {
17-
"settings": {
18-
"editor.formatOnSave": true,
19-
"[rust]": {
20-
"editor.defaultFormatter": "rust-lang.rust-analyzer"
21-
}
22-
}
23-
}
24-
},
25-
// Use 'postCreateCommand' to run commands after the container is created.
26-
"postCreateCommand": "uv venv"
27-
// Use 'mounts' to make the cargo cache persistent in a Docker Volume.
28-
// "mounts": [
29-
// {
30-
// "source": "devcontainer-cargo-cache-${devcontainerId}",
31-
// "target": "/usr/local/cargo",
32-
// "type": "volume"
33-
// }
34-
// ]
35-
// Features to add to the dev container. More info: https://containers.dev/features.
36-
// "features": {},
37-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
38-
// "forwardPorts": [],
39-
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
40-
// "remoteUser": "root"
4+
"name": "Rust",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/rust:1-1-bullseye",
7+
"features": {
8+
"ghcr.io/devcontainers/features/node:1": {},
9+
"ghcr.io/devcontainers/features/python:1": {
10+
"version": "3.10",
11+
"toolsToInstall": "uv"
12+
}
13+
},
14+
// Configure tool-specific properties.
15+
"customizations": {
16+
"vscode": {
17+
"settings": {
18+
"editor.formatOnSave": true,
19+
"[rust]": {
20+
"editor.defaultFormatter": "rust-lang.rust-analyzer"
21+
}
22+
}
23+
}
24+
},
25+
// Use 'postCreateCommand' to run commands after the container is created.
26+
"postCreateCommand": "uv venv && npm install -g @commitlint/config-conventional"
27+
// Use 'mounts' to make the cargo cache persistent in a Docker Volume.
28+
// "mounts": [
29+
// {
30+
// "source": "devcontainer-cargo-cache-${devcontainerId}",
31+
// "target": "/usr/local/cargo",
32+
// "type": "volume"
33+
// }
34+
// ]
35+
// Features to add to the dev container. More info: https://containers.dev/features.
36+
// "features": {},
37+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
38+
// "forwardPorts": [],
39+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
40+
// "remoteUser": "root"
4141
}

crates/rmcp/src/transport.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ pub mod auth;
107107
#[cfg(feature = "auth")]
108108
#[cfg_attr(docsrs, doc(cfg(feature = "auth")))]
109109
pub use auth::{
110-
AuthError, AuthorizationManager, AuthorizationSession, AuthorizedHttpClient, CredentialStore,
111-
InMemoryCredentialStore, InMemoryStateStore, StateStore, StoredAuthorizationState,
112-
StoredCredentials,
110+
AuthClient, AuthError, AuthorizationManager, AuthorizationSession, AuthorizedHttpClient,
111+
CredentialStore, InMemoryCredentialStore, InMemoryStateStore, ScopeUpgradeConfig, StateStore,
112+
StoredAuthorizationState, StoredCredentials, WWWAuthenticateParams,
113113
};
114114

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

0 commit comments

Comments
 (0)