pub struct SuppressionEntry {Show 23 fields
pub id: String,
pub fingerprint: String,
pub rule_id: String,
pub file_path: PathBuf,
pub snippet_hash: Option<String>,
pub context_hash: Option<String>,
pub suppressed_by: String,
pub created_at: String,
pub expires_at: Option<String>,
pub reason: String,
pub ticket_ref: Option<String>,
pub status: SuppressionStatus,
pub original_severity: Severity,
pub tags: HashSet<String>,
pub groups: HashSet<String>,
pub approval: Option<ApprovalInfo>,
pub scheduled_revocation: Option<RevocationSchedule>,
pub policy_id: Option<String>,
pub priority: u8,
pub metadata: HashMap<String, String>,
pub version: u32,
pub updated_at: Option<String>,
pub updated_by: Option<String>,
}Expand description
A suppression entry representing a finding that should be ignored
Fields§
§id: StringUnique identifier for this suppression (UUID)
fingerprint: StringSHA256 fingerprint of the finding being suppressed
rule_id: StringRule ID that generated the finding (e.g., “generic/hardcoded-secret”)
file_path: PathBufPath to the file containing the suppressed finding
snippet_hash: Option<String>Hash of the code snippet for staleness detection (security: no raw code stored)
context_hash: Option<String>Hash of surrounding context for additional staleness detection
suppressed_by: StringWho created this suppression
created_at: StringWhen this suppression was created (ISO 8601)
expires_at: Option<String>When this suppression expires (ISO 8601, optional)
reason: StringReason for the suppression
ticket_ref: Option<String>Reference to a ticket/issue (e.g., “JIRA-456”)
status: SuppressionStatusCurrent status of the suppression
original_severity: SeverityOriginal severity of the finding
Tags for categorization
groups: HashSet<String>Groups this suppression belongs to
approval: Option<ApprovalInfo>Approval workflow info
scheduled_revocation: Option<RevocationSchedule>Scheduled auto-revocation
policy_id: Option<String>Policy that created this suppression (if from policy)
priority: u8Priority level (1-5, 1 being highest)
metadata: HashMap<String, String>Additional metadata
version: u32Version number for optimistic locking
updated_at: Option<String>Last modified timestamp
updated_by: Option<String>Last modified by
Implementations§
Source§impl SuppressionEntry
impl SuppressionEntry
Sourcepub fn new(
fingerprint: impl Into<String>,
rule_id: impl Into<String>,
file_path: impl Into<PathBuf>,
suppressed_by: impl Into<String>,
reason: impl Into<String>,
) -> Self
pub fn new( fingerprint: impl Into<String>, rule_id: impl Into<String>, file_path: impl Into<PathBuf>, suppressed_by: impl Into<String>, reason: impl Into<String>, ) -> Self
Create a new active suppression entry
Sourcepub fn with_snippet(self, snippet: impl AsRef<str>) -> Self
pub fn with_snippet(self, snippet: impl AsRef<str>) -> Self
Set the snippet hash for staleness detection (from raw snippet)
Sourcepub fn with_snippet_hash(self, hash: impl Into<String>) -> Self
pub fn with_snippet_hash(self, hash: impl Into<String>) -> Self
Set the snippet hash directly
Sourcepub fn with_context_hash(self, hash: impl Into<String>) -> Self
pub fn with_context_hash(self, hash: impl Into<String>) -> Self
Set the context hash for additional staleness detection
Sourcepub fn with_expiration(self, expires_at: impl Into<String>) -> Self
pub fn with_expiration(self, expires_at: impl Into<String>) -> Self
Set an expiration date
Sourcepub fn with_expiration_days(self, days: u32) -> Self
pub fn with_expiration_days(self, days: u32) -> Self
Set expiration from a duration string (e.g., “90d”, “30d”, “7d”)
Sourcepub fn with_ticket(self, ticket: impl Into<String>) -> Self
pub fn with_ticket(self, ticket: impl Into<String>) -> Self
Set a ticket reference
Sourcepub fn with_severity(self, severity: Severity) -> Self
pub fn with_severity(self, severity: Severity) -> Self
Set the original severity
Add multiple tags
Sourcepub fn with_group(self, group: impl Into<String>) -> Self
pub fn with_group(self, group: impl Into<String>) -> Self
Add to a group
Sourcepub fn with_priority(self, priority: u8) -> Self
pub fn with_priority(self, priority: u8) -> Self
Set priority (1-5)
Sourcepub fn with_policy(self, policy_id: impl Into<String>) -> Self
pub fn with_policy(self, policy_id: impl Into<String>) -> Self
Set policy ID
Sourcepub fn require_approval(self, min_approvals: usize) -> Self
pub fn require_approval(self, min_approvals: usize) -> Self
Require approval
Sourcepub fn require_approval_from(
self,
approvers: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn require_approval_from( self, approvers: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Require approval from specific approvers
Sourcepub fn schedule_revocation(
self,
scheduled_at: impl Into<String>,
reason: impl Into<String>,
scheduled_by: impl Into<String>,
) -> Self
pub fn schedule_revocation( self, scheduled_at: impl Into<String>, reason: impl Into<String>, scheduled_by: impl Into<String>, ) -> Self
Schedule auto-revocation
Sourcepub fn schedule_revocation_days(
self,
days: u32,
reason: impl Into<String>,
scheduled_by: impl Into<String>,
) -> Self
pub fn schedule_revocation_days( self, days: u32, reason: impl Into<String>, scheduled_by: impl Into<String>, ) -> Self
Schedule auto-revocation in N days
Sourcepub fn with_metadata(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_metadata( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add metadata
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if the suppression has expired
Sourcepub fn is_active(&self) -> bool
pub fn is_active(&self) -> bool
Check if the suppression is active (not expired, revoked, or stale)
Sourcepub fn is_pending_approval(&self) -> bool
pub fn is_pending_approval(&self) -> bool
Check if approval is pending
Sourcepub fn is_approved(&self) -> bool
pub fn is_approved(&self) -> bool
Check if the suppression has been approved
Sourcepub fn approve(&mut self, approver: impl Into<String>, comment: Option<String>)
pub fn approve(&mut self, approver: impl Into<String>, comment: Option<String>)
Approve the suppression
Sourcepub fn reject(&mut self, rejector: impl Into<String>, reason: impl Into<String>)
pub fn reject(&mut self, rejector: impl Into<String>, reason: impl Into<String>)
Reject the suppression
Sourcepub fn mark_stale(&mut self)
pub fn mark_stale(&mut self)
Mark the suppression as stale
Sourcepub fn reactivate(&mut self, actor: impl Into<String>)
pub fn reactivate(&mut self, actor: impl Into<String>)
Reactivate the suppression
Sourcepub fn set_scheduled_revocation(
&mut self,
scheduled_at: impl Into<String>,
reason: impl Into<String>,
scheduled_by: impl Into<String>,
)
pub fn set_scheduled_revocation( &mut self, scheduled_at: impl Into<String>, reason: impl Into<String>, scheduled_by: impl Into<String>, )
Schedule auto-revocation (mutable version)
Sourcepub fn cancel_scheduled_revocation(&mut self)
pub fn cancel_scheduled_revocation(&mut self)
Cancel scheduled revocation
Sourcepub fn add_approval(
&mut self,
approver: impl Into<String>,
comment: Option<&str>,
)
pub fn add_approval( &mut self, approver: impl Into<String>, comment: Option<&str>, )
Add an approval (convenience method for mutable operations)
Sourcepub fn is_stale(&self, current_snippet: Option<&str>) -> bool
pub fn is_stale(&self, current_snippet: Option<&str>) -> bool
Check if the code has changed (staleness detection)
Sourcepub fn is_stale_by_hash(&self, current_snippet_hash: Option<&str>) -> bool
pub fn is_stale_by_hash(&self, current_snippet_hash: Option<&str>) -> bool
Check if the code has changed using a pre-computed hash
Sourcepub fn is_revocation_due(&self) -> bool
pub fn is_revocation_due(&self) -> bool
Check if scheduled revocation is due
Sourcepub fn time_until_expiry(&self) -> Option<String>
pub fn time_until_expiry(&self) -> Option<String>
Get a human-readable description of time until expiration
Get all tags as a sorted vector
Sourcepub fn groups_sorted(&self) -> Vec<&str>
pub fn groups_sorted(&self) -> Vec<&str>
Get all groups as a sorted vector
Trait Implementations§
Source§impl Clone for SuppressionEntry
impl Clone for SuppressionEntry
Source§fn clone(&self) -> SuppressionEntry
fn clone(&self) -> SuppressionEntry
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more