feat: enhance OAuth flow validation and improve security checks; add credential read blocking and git operation safeguards

This commit is contained in:
asepharyana
2026-07-12 11:45:28 +07:00
parent 2efd40ca88
commit 8767beef39
11 changed files with 323 additions and 42 deletions
+2
View File
@@ -22,6 +22,8 @@ pub fn open_or_create(session_dir: &std::path::Path) -> anyhow::Result<rusqlite:
std::fs::create_dir_all(parent)?;
}
let conn = rusqlite::Connection::open(&path)?;
conn.execute_batch("PRAGMA journal_mode = WAL;")?;
conn.execute_batch("PRAGMA busy_timeout = 5000;")?;
schema::init_schema(&conn)?;
Ok(conn)
}
+1
View File
@@ -11,6 +11,7 @@ use anyhow::Result;
///
/// Return: `Ok(())` on success, or the underlying SQLite error.
pub fn init_schema(conn: &Connection) -> Result<()> {
conn.execute_batch("PRAGMA foreign_keys = ON;")?;
conn.execute_batch(
"
CREATE TABLE IF NOT EXISTS messages (