pub struct McpAuthConfig {
pub require_auth: bool,
pub anonymous_methods: Vec<String>,
pub method_role_requirements: HashMap<String, Vec<Role>>,
pub enable_permission_checking: bool,
pub auth_header_name: String,
pub enable_audit_logging: bool,
pub client_ip_header: Option<String>,
}
Expand description
Configuration for MCP authentication middleware
Fields§
§require_auth: bool
Require authentication for all requests
anonymous_methods: Vec<String>
Allow anonymous access to specific methods
method_role_requirements: HashMap<String, Vec<Role>>
Methods that require specific roles
enable_permission_checking: bool
Enable permission checking for tools and resources
auth_header_name: String
Custom authentication header name (default: “Authorization”)
enable_audit_logging: bool
Enable audit logging for authentication events
client_ip_header: Option<String>
Client IP header name for proxy environments
Trait Implementations§
Source§impl Clone for McpAuthConfig
impl Clone for McpAuthConfig
Source§fn clone(&self) -> McpAuthConfig
fn clone(&self) -> McpAuthConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for McpAuthConfig
impl Debug for McpAuthConfig
Auto Trait Implementations§
impl Freeze for McpAuthConfig
impl RefUnwindSafe for McpAuthConfig
impl Send for McpAuthConfig
impl Sync for McpAuthConfig
impl Unpin for McpAuthConfig
impl UnwindSafe for McpAuthConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more