pub struct FindingCache { /* private fields */ }Expand description
Cache for security finding validation results.
Wraps FileCacheImpl with a 7-day TTL for validated findings.
Uses SHA-256 hashes as cache keys to ensure privacy and uniqueness.
Implementations§
Source§impl FindingCache
impl FindingCache
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new finding cache with default settings.
Uses a 7-day TTL and stores cache files in ~/.cache/aptu/security.
Sourcepub fn get(
&self,
repo_owner: &str,
repo_name: &str,
file_path: &str,
pattern_id: &str,
matched_text: &str,
) -> Result<Option<ValidatedFinding>>
pub fn get( &self, repo_owner: &str, repo_name: &str, file_path: &str, pattern_id: &str, matched_text: &str, ) -> Result<Option<ValidatedFinding>>
Get a cached validated finding.
§Arguments
repo_owner- Repository ownerrepo_name- Repository namefile_path- File path where finding was detectedpattern_id- Pattern ID that matchedmatched_text- The matched code snippet
§Returns
The cached validated finding if it exists and is within TTL, None otherwise.
Sourcepub fn set(
&self,
repo_owner: &str,
repo_name: &str,
file_path: &str,
pattern_id: &str,
matched_text: &str,
validated: ValidatedFinding,
) -> Result<()>
pub fn set( &self, repo_owner: &str, repo_name: &str, file_path: &str, pattern_id: &str, matched_text: &str, validated: ValidatedFinding, ) -> Result<()>
Set a cached validated finding.
§Arguments
repo_owner- Repository ownerrepo_name- Repository namefile_path- File path where finding was detectedpattern_id- Pattern ID that matchedmatched_text- The matched code snippetvalidated- The validated finding to cache
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FindingCache
impl RefUnwindSafe for FindingCache
impl Send for FindingCache
impl Sync for FindingCache
impl Unpin for FindingCache
impl UnwindSafe for FindingCache
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more