From 6420efc68ab9780ad5f804a3f433690052be02c1 Mon Sep 17 00:00:00 2001 From: geoffsee <> Date: Fri, 23 May 2025 09:56:47 -0400 Subject: [PATCH] Refactor comments and update session identity logic Revised comments for clarity in main.rs and session_identify.rs. Included an explanatory note about using third-party hosts for signature verification. Removed an unused `.toak-ignore` file. --- .toak-ignore | 3 --- src/main.rs | 2 +- src/session_identify.rs | 2 ++ 3 files changed, 3 insertions(+), 4 deletions(-) delete mode 100644 .toak-ignore diff --git a/.toak-ignore b/.toak-ignore deleted file mode 100644 index e70f0d6..0000000 --- a/.toak-ignore +++ /dev/null @@ -1,3 +0,0 @@ -package.json -genaisrc/genaiscript.d.ts -.toak-ignore \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 18c3a5c..1d1e1c4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,7 +17,7 @@ async fn main() { // Initialize logging init_logging(); - // Load configuration + // init server configuration let config = AppConfig::new(); // Create router with all routes diff --git a/src/session_identify.rs b/src/session_identify.rs index a70a8fd..eb71681 100644 --- a/src/session_identify.rs +++ b/src/session_identify.rs @@ -14,6 +14,8 @@ pub struct SessionIdentity { pub user: Value } +// for a production setup, use a 3rd party host to verify the signature +// I removed in this version because the identity server I built is not open source yet pub async fn session_identify(session_token: &str) -> Result { let session_data_base64 = session_token.split('.').nth(0).ok_or_else(|| anyhow::anyhow!("Invalid session data format"))?; // println!("session_data_base64: {}", session_data_base64);