select_scope (client_auth/scope.rs)

rust-mcp-sdk · crates/rust-mcp-sdk/src/auth/client_auth/scope.rs · rust · MIT
auth

! Scope handling helpers for MCP OAuth client. ! ! Implements the scope-selection strategy from ! [SEP-835](https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization#scope-selection-strategy) ! and the scope-union behavior on re-authorization required by ! [SEP

// Source: https://github.com/rust-mcp-stack/rust-mcp-sdk | License: MIT | Copyright 2025 Rust MCP Stack (rust-mcp-sdk)
// Provided via justclaw.it.com; keep this notice with the code.
//! Scope handling helpers for MCP OAuth client.
//!
//! Implements the scope-selection strategy from
//! [SEP-835](https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization#scope-selection-strategy)
//! and the scope-union behavior on re-authorization required by
//! [SEP-2350](https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization#scope-challenge-handling).

use std::collections::BTreeSet;

/// Apply SEP-835 scope-selection strategy: pick the first non-empty value
/// from the prioritized list:
///
/// 1. `scope` parameter from the `WWW-Authenticate` challenge
/// 2

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key