#[non_exhaustive]pub enum OAuthScopeContext {
NonOauth,
Scopes(Vec<String>),
}Expand description
I10c-β2(R3 MUST-FIX 修复):调用路径的 OAuth 上下文,显式区分“非 OAuth“与“OAuth + scope“。
出现在 Firewall::evaluate 签名里作为必填参数,强制调用方每次调用都明确选择,
防止 HTTP MCP 集成点意外漏配 scope 导致静默绕过。
OAuthScopeContext::NonOauth—— stdio MCP / 本地工具 / 不走 OAuth 的任何路径OAuthScopeContext::Scopes—— HTTP MCP + OAuth access token,scope 来自vigil_http_auth::ResolvedAccessToken::scope_set(空集也必须显式Scopes(vec![]), 触发ScopeNotInAllowList的 fail-closed 分支)
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
NonOauth
非 OAuth 路径,ScopeNotInAllowList 不适用
Scopes(Vec<String>)
OAuth 路径 + token 携带的 scope 集合(可空 → fail-closed)
Trait Implementations§
Source§impl Clone for OAuthScopeContext
impl Clone for OAuthScopeContext
Source§fn clone(&self) -> OAuthScopeContext
fn clone(&self) -> OAuthScopeContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 OAuthScopeContext
impl Debug for OAuthScopeContext
impl Eq for OAuthScopeContext
Source§impl PartialEq for OAuthScopeContext
impl PartialEq for OAuthScopeContext
Source§fn eq(&self, other: &OAuthScopeContext) -> bool
fn eq(&self, other: &OAuthScopeContext) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for OAuthScopeContext
Auto Trait Implementations§
impl Freeze for OAuthScopeContext
impl RefUnwindSafe for OAuthScopeContext
impl Send for OAuthScopeContext
impl Sync for OAuthScopeContext
impl Unpin for OAuthScopeContext
impl UnsafeUnpin for OAuthScopeContext
impl UnwindSafe for OAuthScopeContext
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