add: user grants

TODO: add grant creation api, grant tab in sessions tab of settings, grant api endpoints
This commit is contained in:
trisua 2025-05-31 14:38:38 -04:00
parent 7de2c2e935
commit bf27c51ad3
8 changed files with 98 additions and 7 deletions

View file

@ -1,6 +1,6 @@
use std::collections::HashMap;
use super::permissions::FinePermission;
use super::{oauth::AuthGrant, permissions::FinePermission};
use serde::{Deserialize, Serialize};
use totp_rs::TOTP;
use tetratto_shared::{
@ -43,6 +43,9 @@ pub struct User {
/// The user's Stripe customer ID.
#[serde(default)]
pub stripe_id: String,
/// The grants associated with the user's account.
#[serde(default)]
pub grants: Vec<AuthGrant>,
}
pub type UserConnections =
@ -251,6 +254,7 @@ impl User {
request_count: 0,
connections: HashMap::new(),
stripe_id: String::new(),
grants: Vec::new(),
}
}