feat: initial oauth2 token revoking

This commit is contained in:
Zomatree
2025-07-02 03:45:43 +01:00
parent 5a5f84f207
commit 660e646b2b
19 changed files with 358 additions and 8 deletions

View File

@@ -0,0 +1,27 @@
use iso8601_timestamp::Timestamp;
auto_derived!(
/// Unique id of the user and bot
pub struct AuthorizedBotId {
/// User id
pub user: String,
/// Bot Id
pub bot: String,
}
pub struct AuthorizedBot {
/// Unique Id
#[serde(rename = "_id")]
pub id: AuthorizedBotId,
/// When the authorized oauth2 bot connection was created at
pub created_at: Timestamp,
/// If and when the authorized oauth2 bot connection was revoked at
pub deauthorized_at: Option<Timestamp>,
/// Scopes the bot has access to
pub scope: String
}
);

View File

@@ -1,3 +1,4 @@
mod authorized_bots;
mod bots;
mod channel_invites;
mod channel_unreads;
@@ -16,6 +17,7 @@ mod servers;
mod user_settings;
mod users;
pub use authorized_bots::*;
pub use bots::*;
pub use channel_invites::*;
pub use channel_unreads::*;