Skip to content

Commit 1ffeb8a

Browse files
Copilotlarp0
andcommitted
Address comprehensive audit system feedback: AI validation, enhanced security checks, session IDs, and improved test coverage
Co-authored-by: larp0 <[email protected]>
1 parent a58846b commit 1ffeb8a

File tree

3 files changed

+498
-39
lines changed

3 files changed

+498
-39
lines changed

src/services/audit_service.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,14 @@ impl AuditService {
7575
println!("🤖 AI analysis will be enabled with provided API key");
7676
}
7777
Ok(_) => {
78-
println!("⚠️ OPENAI_API_KEY is empty, AI analysis will be disabled");
78+
return Err(AuditError::EnvironmentError(
79+
"OPENAI_API_KEY is empty but AI analysis was requested. Please provide a valid API key or disable AI analysis.".to_string()
80+
));
7981
}
8082
Err(_) => {
81-
println!("⚠️ OPENAI_API_KEY not found, AI analysis will be disabled");
83+
return Err(AuditError::EnvironmentError(
84+
"OPENAI_API_KEY not found but AI analysis was requested. Please set the environment variable or disable AI analysis.".to_string()
85+
));
8286
}
8387
}
8488
}

0 commit comments

Comments
 (0)