Initial commit: Compliance Scanner Agent
Autonomous security and compliance scanning agent for git repositories. Features: SAST (Semgrep), SBOM (Syft), CVE monitoring (OSV.dev/NVD), GDPR/OAuth pattern detection, LLM triage, issue creation (GitHub/GitLab/Jira), PR reviews, and Dioxus fullstack dashboard. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
77
compliance-core/src/models/issue.rs
Normal file
77
compliance-core/src/models/issue.rs
Normal file
@@ -0,0 +1,77 @@
|
||||
use chrono::{DateTime, Utc};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum TrackerType {
|
||||
GitHub,
|
||||
GitLab,
|
||||
Jira,
|
||||
}
|
||||
|
||||
impl std::fmt::Display for TrackerType {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::GitHub => write!(f, "github"),
|
||||
Self::GitLab => write!(f, "gitlab"),
|
||||
Self::Jira => write!(f, "jira"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum IssueStatus {
|
||||
Open,
|
||||
InProgress,
|
||||
Closed,
|
||||
Resolved,
|
||||
}
|
||||
|
||||
impl std::fmt::Display for IssueStatus {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::Open => write!(f, "open"),
|
||||
Self::InProgress => write!(f, "in_progress"),
|
||||
Self::Closed => write!(f, "closed"),
|
||||
Self::Resolved => write!(f, "resolved"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct TrackerIssue {
|
||||
#[serde(rename = "_id", skip_serializing_if = "Option::is_none")]
|
||||
pub id: Option<mongodb::bson::oid::ObjectId>,
|
||||
pub finding_id: String,
|
||||
pub tracker_type: TrackerType,
|
||||
pub external_id: String,
|
||||
pub external_url: String,
|
||||
pub title: String,
|
||||
pub status: IssueStatus,
|
||||
pub created_at: DateTime<Utc>,
|
||||
pub updated_at: DateTime<Utc>,
|
||||
}
|
||||
|
||||
impl TrackerIssue {
|
||||
pub fn new(
|
||||
finding_id: String,
|
||||
tracker_type: TrackerType,
|
||||
external_id: String,
|
||||
external_url: String,
|
||||
title: String,
|
||||
) -> Self {
|
||||
let now = Utc::now();
|
||||
Self {
|
||||
id: None,
|
||||
finding_id,
|
||||
tracker_type,
|
||||
external_id,
|
||||
external_url,
|
||||
title,
|
||||
status: IssueStatus::Open,
|
||||
created_at: now,
|
||||
updated_at: now,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user