pub struct SsoTicket {
pub ticket_id: String,
pub service: String,
pub login_id: String,
pub create_time: DateTime<Utc>,
pub expire_time: DateTime<Utc>,
pub used: bool,
}Expand description
SSO 票据结构 | SSO Ticket Structure
票据是一个短期、一次性使用的认证令牌 A ticket is a short-lived, one-time use authentication token
Fields§
§ticket_id: String票据唯一标识符(UUID)| Unique ticket identifier (UUID)
service: String目标服务 URL | Target service URL
login_id: String用户登录 ID | User login ID
create_time: DateTime<Utc>票据创建时间 | Ticket creation time
expire_time: DateTime<Utc>票据过期时间 | Ticket expiration time
used: bool是否已使用(一次性使用)| Whether used (one-time use)
Implementations§
Source§impl SsoTicket
impl SsoTicket
Sourcepub fn new(login_id: String, service: String, timeout_seconds: i64) -> Self
pub fn new(login_id: String, service: String, timeout_seconds: i64) -> Self
创建新票据 | Create a new ticket
§参数 | Parameters
login_id- 用户登录 ID | User login IDservice- 目标服务 URL | Target service URLtimeout_seconds- 票据有效期(秒)| Ticket validity period (seconds)
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
检查票据是否过期 | Check if ticket is expired
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SsoTicket
impl<'de> Deserialize<'de> for SsoTicket
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
Auto Trait Implementations§
impl Freeze for SsoTicket
impl RefUnwindSafe for SsoTicket
impl Send for SsoTicket
impl Sync for SsoTicket
impl Unpin for SsoTicket
impl UnwindSafe for SsoTicket
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)