Skip to main content

kellnr_entity/
oauth2_state.rs

1//! `SeaORM` Entity for `OAuth2` state (PKCE/CSRF storage during auth flow)
2
3use sea_orm::entity::prelude::*;
4
5#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
6#[sea_orm(table_name = "oauth2_state")]
7pub struct Model {
8    #[sea_orm(primary_key)]
9    pub id: i64,
10    #[sea_orm(column_type = "Text", unique)]
11    pub state: String,
12    #[sea_orm(column_type = "Text")]
13    pub pkce_verifier: String,
14    #[sea_orm(column_type = "Text")]
15    pub nonce: String,
16    #[sea_orm(column_type = "Text")]
17    pub created: String,
18}
19
20#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
21pub enum Relation {}
22
23impl ActiveModelBehavior for ActiveModel {}