fediverse_blocked_domain.rs
35 lignes · 1177 octets
//! `fediverse_blocked_domains` SeaORM entity (RFC 0004). //! //! Blocklist of remote Fediverse domains explicitly refused by the local //! admin. Used when `app_settings.fediverse_trust_mode = "open_with_blocklist"`. use chrono::{DateTime, Utc}; use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; use uuid::Uuid; /// `fediverse_blocked_domains` row. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, DeriveEntityModel)] #[sea_orm(table_name = "fediverse_blocked_domains")] pub struct Model { /// Primary key. #[sea_orm(primary_key, auto_increment = false)] pub id: Uuid, /// Bare domain name, lowercased and stripped of `www.` prefix. #[sea_orm(unique)] pub domain: String, /// `"suspend"`, `"silence"`, or `"reject_auth"`. pub severity: String, /// Optional admin reason for blocking. pub reason: Option<String>, /// User that added the entry. pub added_by_user_id: Option<Uuid>, /// Insertion timestamp. pub created_at: DateTime<Utc>, } /// SeaORM relations (none). #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] pub enum Relation {} impl ActiveModelBehavior for ActiveModel {}
GitRust