diff --git a/src/compliance/mod.rs b/src/compliance/mod.rs index bce492d1e..3636b2e80 100644 --- a/src/compliance/mod.rs +++ b/src/compliance/mod.rs @@ -1,14 +1,3 @@ - - - - - - - - - - - use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use std::collections::HashMap; @@ -20,13 +9,11 @@ pub mod policy_checker; pub mod risk_assessment; pub mod training_tracker; - pub use code_scanner::{ CodeIssue, CodeScanner, ComplianceReporter, ComplianceScanResult, IssueSeverity, IssueType, ScanStats, }; - #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] pub enum ComplianceFramework { GDPR, @@ -36,7 +23,6 @@ pub enum ComplianceFramework { PCIDSS, } - #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] pub enum ComplianceStatus { Compliant, @@ -46,7 +32,6 @@ pub enum ComplianceStatus { NotApplicable, } - #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum Severity { Low, @@ -55,7 +40,6 @@ pub enum Severity { Critical, } - #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ComplianceCheckResult { pub framework: ComplianceFramework, @@ -68,7 +52,6 @@ pub struct ComplianceCheckResult { pub evidence: Vec, } - #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ComplianceIssue { pub id: String, @@ -80,7 +63,6 @@ pub struct ComplianceIssue { pub assigned_to: Option, } - #[derive(Debug, Clone, Serialize, Deserialize)] pub struct AuditLogEntry { pub id: String, @@ -96,7 +78,6 @@ pub struct AuditLogEntry { pub metadata: HashMap, } - #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] pub enum AuditEventType { Access, @@ -108,7 +89,6 @@ pub enum AuditEventType { Authorization, } - #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] pub enum ActionResult { Success, @@ -117,7 +97,6 @@ pub enum ActionResult { Error, } - #[derive(Debug, Clone, Serialize, Deserialize)] pub struct RiskAssessment { pub id: String, @@ -130,7 +109,6 @@ pub struct RiskAssessment { pub risks: Vec, } - #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Risk { pub id: String, @@ -145,7 +123,6 @@ pub struct Risk { pub status: RiskStatus, } - #[derive(Debug, Clone, Serialize, Deserialize)] pub enum RiskCategory { Technical, @@ -155,7 +132,6 @@ pub enum RiskCategory { Reputational, } - #[derive(Debug, Clone, Serialize, Deserialize)] pub enum TreatmentStrategy { Mitigate, @@ -164,7 +140,6 @@ pub enum TreatmentStrategy { Avoid, } - #[derive(Debug, Clone, Serialize, Deserialize)] pub enum RiskStatus { Open, @@ -174,7 +149,6 @@ pub enum RiskStatus { Closed, } - #[derive(Debug, Clone, Serialize, Deserialize)] pub struct TrainingRecord { pub id: String, @@ -187,7 +161,6 @@ pub struct TrainingRecord { pub certificate_url: Option, } - #[derive(Debug, Clone, Serialize, Deserialize)] pub enum TrainingType { SecurityAwareness, @@ -197,7 +170,6 @@ pub enum TrainingType { RoleSpecific, } - #[derive(Debug, Clone, Serialize, Deserialize)] pub struct AccessReview { pub id: String, @@ -210,7 +182,6 @@ pub struct AccessReview { pub status: ReviewStatus, } - #[derive(Debug, Clone, Serialize, Deserialize)] pub struct PermissionReview { pub resource_type: String, @@ -220,7 +191,6 @@ pub struct PermissionReview { pub action: ReviewAction, } - #[derive(Debug, Clone, Serialize, Deserialize)] pub enum ReviewAction { Approved, @@ -229,7 +199,6 @@ pub enum ReviewAction { FlaggedForReview, } - #[derive(Debug, Clone, Serialize, Deserialize)] pub enum ReviewStatus { Pending, @@ -238,24 +207,21 @@ pub enum ReviewStatus { Approved, } - pub struct ComplianceMonitor { enabled_frameworks: Vec, - check_interval_hours: u32, - auto_remediate: bool, + _check_interval_hours: u32, + _auto_remediate: bool, } impl ComplianceMonitor { - pub fn new(frameworks: Vec) -> Self { Self { enabled_frameworks: frameworks, - check_interval_hours: 24, - auto_remediate: false, + _check_interval_hours: 24, + _auto_remediate: false, } } - pub async fn run_checks( &self, ) -> Result, Box> { @@ -269,7 +235,6 @@ impl ComplianceMonitor { Ok(results) } - async fn check_framework( &self, framework: &ComplianceFramework, @@ -283,11 +248,9 @@ impl ComplianceMonitor { } } - async fn check_gdpr(&self) -> Result, Box> { let mut results = Vec::new(); - results.push(ComplianceCheckResult { framework: ComplianceFramework::GDPR, control_id: "gdpr_7.2".to_string(), @@ -299,7 +262,6 @@ impl ComplianceMonitor { evidence: vec!["Automated data deletion configured".to_string()], }); - results.push(ComplianceCheckResult { framework: ComplianceFramework::GDPR, control_id: "gdpr_5.1.f".to_string(), @@ -311,7 +273,6 @@ impl ComplianceMonitor { evidence: vec!["AES-256-GCM encryption enabled".to_string()], }); - results.push(ComplianceCheckResult { framework: ComplianceFramework::GDPR, control_id: "gdpr_6.1".to_string(), @@ -326,11 +287,9 @@ impl ComplianceMonitor { Ok(results) } - async fn check_soc2(&self) -> Result, Box> { let mut results = Vec::new(); - results.push(ComplianceCheckResult { framework: ComplianceFramework::SOC2, control_id: "cc6.1".to_string(), @@ -345,13 +304,11 @@ impl ComplianceMonitor { Ok(results) } - async fn check_iso27001( &self, ) -> Result, Box> { let mut results = Vec::new(); - results.push(ComplianceCheckResult { framework: ComplianceFramework::ISO27001, control_id: "a.8.1".to_string(), @@ -366,19 +323,16 @@ impl ComplianceMonitor { Ok(results) } - async fn check_hipaa(&self) -> Result, Box> { Ok(vec![]) } - async fn check_pci_dss( &self, ) -> Result, Box> { Ok(vec![]) } - pub fn calculate_compliance_score(results: &[ComplianceCheckResult]) -> f64 { if results.is_empty() { return 0.0; @@ -388,7 +342,6 @@ impl ComplianceMonitor { total / results.len() as f64 } - pub fn generate_report(results: &[ComplianceCheckResult]) -> ComplianceReport { let mut issues_by_severity = HashMap::new(); let mut total_issues = 0; @@ -420,7 +373,6 @@ impl ComplianceMonitor { } } - #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ComplianceReport { pub generated_at: DateTime, diff --git a/src/compliance/policy_checker.rs b/src/compliance/policy_checker.rs index 46bdae04e..013916b99 100644 --- a/src/compliance/policy_checker.rs +++ b/src/compliance/policy_checker.rs @@ -383,7 +383,7 @@ impl PolicyChecker { .clone(); let mut violations = Vec::new(); - let mut warnings = Vec::new(); + let warnings = Vec::new(); for rule in &policy.rules { if !self.evaluate_rule(rule, context) { diff --git a/src/drive/vectordb.rs b/src/drive/vectordb.rs index de70c4275..397beb2d3 100644 --- a/src/drive/vectordb.rs +++ b/src/drive/vectordb.rs @@ -54,7 +54,7 @@ pub struct UserDriveVectorDB { user_id: Uuid, bot_id: Uuid, collection_name: String, - db_path: PathBuf, + _db_path: PathBuf, #[cfg(feature = "vectordb")] client: Option>, } diff --git a/src/weba/mod.rs b/src/weba/mod.rs index b1e71890f..8c851ebc0 100644 --- a/src/weba/mod.rs +++ b/src/weba/mod.rs @@ -92,7 +92,7 @@ pub enum ComponentType { pub struct WebaState { apps: RwLock>, pages: RwLock>, - components: RwLock>, + _components: RwLock>, } impl WebaState { @@ -100,7 +100,7 @@ impl WebaState { Self { apps: RwLock::new(HashMap::new()), pages: RwLock::new(HashMap::new()), - components: RwLock::new(HashMap::new()), + _components: RwLock::new(HashMap::new()), } } }