1use crate::{AuthorId, AuthorKind, ProjectId, TenantId, UserRole, VersionId, scopes::Scopes};
2use serde::{Deserialize, Serialize};
3
4#[derive(Serialize, Deserialize, Debug, Clone)]
5pub struct UserTokenClaims {
6 pub sub: AuthorId,
7 pub exp: usize,
8 pub aud: String,
9 pub scope: Scopes,
10
11 #[serde(rename = "https://haste.health/tenant")]
12 pub tenant: TenantId,
13 #[serde(rename = "https://haste.health/project")]
14 pub project: Option<ProjectId>,
15 #[serde(rename = "https://haste.health/user_role")]
16 pub user_role: UserRole,
17 #[serde(rename = "https://haste.health/user_id")]
18 pub user_id: AuthorId,
19 #[serde(rename = "https://haste.health/resource_type")]
20 pub resource_type: AuthorKind,
21 #[serde(rename = "https://haste.health/access_policies")]
22 pub access_policy_version_ids: Vec<VersionId>,
23 #[serde(rename = "https://haste.health/membership")]
24 pub membership: Option<String>,
25}