pub(crate) struct CallerSnapshot {
pub rec: Option<Arc<KeyRecord>>,
pub key_id: Option<String>,
pub allowed_acc_ids: Option<HashSet<u64>>,
pub bearer_token: Option<String>,
}Expand description
Caller authenticated identity snapshot returned by MCP auth guards. Captured once at auth time; subsequent response filtering / push subscriber registration / visibility uses this snapshot rather than re-resolving from Bearer/startup (防 SIGHUP reload race / drift between auth decision and side effect).
rec=None 表示 legacy mode (KeyStore 未 configured) — 全放行,
allowed_acc_ids = None (无限制).
Fields§
§rec: Option<Arc<KeyRecord>>caller’s KeyRecord at auth time. legacy mode -> None.
key_id: Option<String>caller’s key_id (legacy mode -> None).
allowed_acc_ids: Option<HashSet<u64>>caller’s allowed_acc_ids snapshot (HashSet clone, owned). None = 无限制 (无 KeyRecord 或 KeyRecord 没设).
bearer_token: Option<String>HTTP Authorization Bearer token snapshot. legacy mode / stdio -> None.
Trait Implementations§
Source§impl Clone for CallerSnapshot
impl Clone for CallerSnapshot
Source§fn clone(&self) -> CallerSnapshot
fn clone(&self) -> CallerSnapshot
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 moreAuto Trait Implementations§
impl Freeze for CallerSnapshot
impl RefUnwindSafe for CallerSnapshot
impl Send for CallerSnapshot
impl Sync for CallerSnapshot
impl Unpin for CallerSnapshot
impl UnsafeUnpin for CallerSnapshot
impl UnwindSafe for CallerSnapshot
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more