use appcore_types::TenantId;
#[derive(Debug, Clone)]
pub struct GatewaySession {
pub session_id: String,
pub tenant_id: TenantId,
pub created_at_ms: u64,
pub expires_at_ms: u64,
pub subject: Option<String>,
}
impl GatewaySession {
pub fn new(
session_id: String,
tenant_id: TenantId,
created_at_ms: u64,
expires_at_ms: u64,
subject: Option<String>,
) -> Self {
Self {
session_id,
tenant_id,
created_at_ms,
expires_at_ms,
subject,
}
}
pub fn is_expired(&self, now_ms: u64) -> bool {
now_ms >= self.expires_at_ms
}
}