From 685030c44e3b7ffc33fb6797963913de7aa6ae04 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 4 Jul 2026 20:07:19 -0400 Subject: [PATCH] Making changes related to breaking changes --- src/auth/mod.rs | 4 +--- src/caller/instant.rs | 23 +++++++++++------------ src/config/mod.rs | 2 +- src/db/mod.rs | 4 +--- 4 files changed, 14 insertions(+), 19 deletions(-) diff --git a/src/auth/mod.rs b/src/auth/mod.rs index 84b764e..df20507 100644 --- a/src/auth/mod.rs +++ b/src/auth/mod.rs @@ -36,9 +36,7 @@ pub async fn auth( (StatusCode::UNAUTHORIZED, Json(json_error)) })?; - let secret_key = textsender_models::envy::environment::get_secret_main_key() - .await - .value; + let secret_key = textsender_models::envy::environment::get_secret_main_key().value; let mut validation = Validation::new(jsonwebtoken::Algorithm::HS256); validation.set_audience(&["textsender"]); // Must match exactly what's in the token diff --git a/src/caller/instant.rs b/src/caller/instant.rs index 4b1fcb8..5ce1242 100644 --- a/src/caller/instant.rs +++ b/src/caller/instant.rs @@ -81,18 +81,17 @@ pub mod endpoint { match message_repo::get(&pool, &payload.message_id).await { Ok(message) => { println!("Valid message"); - let t_config = - match textsender_models::config::auxiliary::load_config().await { - Ok(config) => config, - Err(err) => { - eprintln!("Error: {err:?}"); - response.message = String::from("Error getting config"); - return ( - axum::http::StatusCode::INTERNAL_SERVER_ERROR, - axum::Json(response), - ); - } - }; + let t_config = match textsender_models::config::auxiliary::load_config() { + Ok(config) => config, + Err(err) => { + eprintln!("Error: {err:?}"); + response.message = String::from("Error getting config"); + return ( + axum::http::StatusCode::INTERNAL_SERVER_ERROR, + axum::Json(response), + ); + } + }; let mut results: Vec< textsender_models::message::event::MessageEventResponse, > = Vec::new(); diff --git a/src/config/mod.rs b/src/config/mod.rs index 64f871e..3e01e57 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -50,7 +50,7 @@ pub mod init { Ok("production") => { // In production, allow only your specific, trusted origins let allowed_origins_env = - textsender_models::envy::environment::get_allowed_origins().await; + textsender_models::envy::environment::get_allowed_origins(); match textsender_models::envy::utility::delimitize(&allowed_origins_env) { Ok(alwd) => { let allowed_origins: Vec = alwd diff --git a/src/db/mod.rs b/src/db/mod.rs index d6fe47d..a852536 100644 --- a/src/db/mod.rs +++ b/src/db/mod.rs @@ -5,9 +5,7 @@ pub mod connection_settings { } pub async fn create_pool() -> Result { - let database_url = textsender_models::envy::environment::get_db_url() - .await - .value; + let database_url = textsender_models::envy::environment::get_db_url().value; println!("Database url: {database_url}"); PgPoolOptions::new()