Skip to main content

SuppressionEntry

Struct SuppressionEntry 

Source
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: String

Unique identifier for this suppression (UUID)

§fingerprint: String

SHA256 fingerprint of the finding being suppressed

§rule_id: String

Rule ID that generated the finding (e.g., “generic/hardcoded-secret”)

§file_path: PathBuf

Path 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: String

Who created this suppression

§created_at: String

When this suppression was created (ISO 8601)

§expires_at: Option<String>

When this suppression expires (ISO 8601, optional)

§reason: String

Reason for the suppression

§ticket_ref: Option<String>

Reference to a ticket/issue (e.g., “JIRA-456”)

§status: SuppressionStatus

Current status of the suppression

§original_severity: Severity

Original severity of the finding

§tags: HashSet<String>

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: u8

Priority level (1-5, 1 being highest)

§metadata: HashMap<String, String>

Additional metadata

§version: u32

Version number for optimistic locking

§updated_at: Option<String>

Last modified timestamp

§updated_by: Option<String>

Last modified by

Implementations§

Source§

impl SuppressionEntry

Source

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

Source

pub fn with_snippet(self, snippet: impl AsRef<str>) -> Self

Set the snippet hash for staleness detection (from raw snippet)

Source

pub fn with_snippet_hash(self, hash: impl Into<String>) -> Self

Set the snippet hash directly

Source

pub fn with_context_hash(self, hash: impl Into<String>) -> Self

Set the context hash for additional staleness detection

Source

pub fn with_expiration(self, expires_at: impl Into<String>) -> Self

Set an expiration date

Source

pub fn with_expiration_days(self, days: u32) -> Self

Set expiration from a duration string (e.g., “90d”, “30d”, “7d”)

Source

pub fn with_ticket(self, ticket: impl Into<String>) -> Self

Set a ticket reference

Source

pub fn with_severity(self, severity: Severity) -> Self

Set the original severity

Source

pub fn with_tag(self, tag: impl Into<String>) -> Self

Add a tag

Source

pub fn with_tags( self, tags: impl IntoIterator<Item = impl Into<String>>, ) -> Self

Add multiple tags

Source

pub fn with_group(self, group: impl Into<String>) -> Self

Add to a group

Source

pub fn with_priority(self, priority: u8) -> Self

Set priority (1-5)

Source

pub fn with_policy(self, policy_id: impl Into<String>) -> Self

Set policy ID

Source

pub fn require_approval(self, min_approvals: usize) -> Self

Require approval

Source

pub fn require_approval_from( self, approvers: impl IntoIterator<Item = impl Into<String>>, ) -> Self

Require approval from specific approvers

Source

pub fn schedule_revocation( self, scheduled_at: impl Into<String>, reason: impl Into<String>, scheduled_by: impl Into<String>, ) -> Self

Schedule auto-revocation

Source

pub fn schedule_revocation_days( self, days: u32, reason: impl Into<String>, scheduled_by: impl Into<String>, ) -> Self

Schedule auto-revocation in N days

Source

pub fn with_metadata( self, key: impl Into<String>, value: impl Into<String>, ) -> Self

Add metadata

Source

pub fn is_expired(&self) -> bool

Check if the suppression has expired

Source

pub fn is_active(&self) -> bool

Check if the suppression is active (not expired, revoked, or stale)

Source

pub fn is_pending_approval(&self) -> bool

Check if approval is pending

Source

pub fn is_approved(&self) -> bool

Check if the suppression has been approved

Source

pub fn approve(&mut self, approver: impl Into<String>, comment: Option<String>)

Approve the suppression

Source

pub fn reject(&mut self, rejector: impl Into<String>, reason: impl Into<String>)

Reject the suppression

Source

pub fn revoke(&mut self)

Mark the suppression as revoked

Source

pub fn mark_stale(&mut self)

Mark the suppression as stale

Source

pub fn reactivate(&mut self, actor: impl Into<String>)

Reactivate the suppression

Source

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)

Source

pub fn cancel_scheduled_revocation(&mut self)

Cancel scheduled revocation

Source

pub fn add_approval( &mut self, approver: impl Into<String>, comment: Option<&str>, )

Add an approval (convenience method for mutable operations)

Source

pub fn is_stale(&self, current_snippet: Option<&str>) -> bool

Check if the code has changed (staleness detection)

Source

pub fn is_stale_by_hash(&self, current_snippet_hash: Option<&str>) -> bool

Check if the code has changed using a pre-computed hash

Source

pub fn is_revocation_due(&self) -> bool

Check if scheduled revocation is due

Source

pub fn time_until_expiry(&self) -> Option<String>

Get a human-readable description of time until expiration

Source

pub fn has_tag(&self, tag: &str) -> bool

Check if this suppression has a specific tag

Source

pub fn in_group(&self, group: &str) -> bool

Check if this suppression is in a specific group

Source

pub fn tags_sorted(&self) -> Vec<&str>

Get all tags as a sorted vector

Source

pub fn groups_sorted(&self) -> Vec<&str>

Get all groups as a sorted vector

Trait Implementations§

Source§

impl Clone for SuppressionEntry

Source§

fn clone(&self) -> SuppressionEntry

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SuppressionEntry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SuppressionEntry

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for SuppressionEntry

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,