#[non_exhaustive]pub struct AuthAuditEvent {
pub request_id: String,
pub action: &'static str,
pub subject: Option<String>,
pub error_code: Option<&'static str>,
}Expand description
认证审计事件。
描述一次认证相关操作(登录/刷新/登出)的结果。绝不携带凭据明文或 Token
原文:需要标识 Token 时只放指纹(token_fingerprint)。
标注 #[non_exhaustive]:未来新增字段不构成破坏性变更。
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.request_id: String本次派发的 request_id(十六进制串)
action: &'static str操作名("login" / "refresh" / "logout",静态)
subject: Option<String>主体标识(用户名或 sub);失败且未知时为 None
error_code: Option<&'static str>失败时的错误码(BaseError::code_str,静态);成功时为 None
Trait Implementations§
Source§impl Clone for AuthAuditEvent
impl Clone for AuthAuditEvent
Auto Trait Implementations§
impl Forget for AuthAuditEvent
impl Freeze for AuthAuditEvent
impl Move for AuthAuditEvent
impl RefUnwindSafe for AuthAuditEvent
impl Send for AuthAuditEvent
impl Sync for AuthAuditEvent
impl Unpin for AuthAuditEvent
impl UnsafeUnpin for AuthAuditEvent
impl UnwindSafe for AuthAuditEvent
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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