Skip to main content

doido_auth/
identity.rs

1//! Resolved auth subject identity before the full user model is loaded.
2
3use serde::{Deserialize, Serialize};
4use serde_json::Value;
5
6/// A lightweight identity resolved by a strategy (session cookie, JWT, OAuth, …).
7#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
8pub struct AuthIdentity {
9    pub user_id: Value,
10}
11
12impl AuthIdentity {
13    pub fn new(user_id: impl Into<Value>) -> Self {
14        Self {
15            user_id: user_id.into(),
16        }
17    }
18}