pub struct McpToken {
pub id: String,
pub user_id: i32,
pub name: String,
pub scope: TokenScope,
pub token_enc: String,
pub token_hash: String,
pub created_at: DateTime<Utc>,
pub expires_at: Option<DateTime<Utc>>,
pub last_used_at: Option<DateTime<Utc>>,
pub revoked_at: Option<DateTime<Utc>>,
}Expand description
mcp_tokens 表一行(不含明文;密文在 token_enc)。
Fields§
§id: String§user_id: i32§name: String§scope: TokenScope§token_enc: StringAES-GCM 密文 hex(nonce ‖ ct ‖ tag)。仅服务端解密使用,不向前端暴露。
token_hash: String明文 SHA-256 hex。仅服务端查找用,不向前端暴露。
created_at: DateTime<Utc>§expires_at: Option<DateTime<Utc>>§last_used_at: Option<DateTime<Utc>>§revoked_at: Option<DateTime<Utc>>Trait Implementations§
Source§impl<'de> Deserialize<'de> for McpToken
impl<'de> Deserialize<'de> for McpToken
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<McpToken> for McpTokenSummary
impl From<McpToken> for McpTokenSummary
impl StructuralPartialEq for McpToken
Auto Trait Implementations§
impl Freeze for McpToken
impl RefUnwindSafe for McpToken
impl Send for McpToken
impl Sync for McpToken
impl Unpin for McpToken
impl UnsafeUnpin for McpToken
impl UnwindSafe for McpToken
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> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
§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>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.
§impl<T> Transportable for Twhere
T: Serialize + DeserializeOwned + 'static,
impl<T> Transportable for Twhere
T: Serialize + DeserializeOwned + 'static,
§fn transport_to_bytes(&self) -> Vec<u8> ⓘ
fn transport_to_bytes(&self) -> Vec<u8> ⓘ
Serialize the type to a byte vector for transport
§fn transport_from_bytes(bytes: &[u8]) -> Result<T, Error<Error>>
fn transport_from_bytes(bytes: &[u8]) -> Result<T, Error<Error>>
Deserialize the type from a byte slice