feat: initial oauth2 token revoking
This commit is contained in:
27
crates/core/models/src/v0/authorized_bots.rs
Normal file
27
crates/core/models/src/v0/authorized_bots.rs
Normal 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
|
||||
}
|
||||
);
|
||||
@@ -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::*;
|
||||
|
||||
Reference in New Issue
Block a user