Skip to main content

cognee_models/
user.rs

1use chrono::{DateTime, Utc};
2use serde::{Deserialize, Serialize};
3use uuid::Uuid;
4
5/// A registered user. Corresponds to Python `cognee.modules.users.models.User`.
6///
7/// Fields intentionally omit `hashed_password` -- the Rust SDK does not
8/// implement authentication (see non-goal note in the gap doc). Password
9/// handling is delegated to whatever HTTP/auth layer sits on top.
10#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
11pub struct User {
12    pub id: Uuid,
13    pub email: String,
14    pub is_active: bool,
15    pub is_superuser: bool,
16    /// The user's currently-selected tenant (can be `None` for the
17    /// single-user default tenant).
18    pub tenant_id: Option<Uuid>,
19    pub created_at: DateTime<Utc>,
20    pub updated_at: Option<DateTime<Utc>>,
21}