use crate::tina::{data::AppResult, server::application::AppConfig};
use super::UpdateableConfig;
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(crate = "serde")]
pub struct SecurityConfig {
pub token_header_name: String,
pub token_secret: String,
pub token_expire_time: u32,
}
impl Default for SecurityConfig {
fn default() -> Self {
Self {
token_header_name: "Authorization".to_owned(),
token_secret: "abcdefghijklmnopqrstuvwxyz".to_owned(),
token_expire_time: 30,
}
}
}
#[async_trait]
impl UpdateableConfig for SecurityConfig {
async fn apply(&self, _application: &AppConfig) -> AppResult<()> {
Ok(())
}
}