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 async fn get(
&self,
repo_owner: &str,
repo_name: &str,
file_path: &str,
pattern_id: &str,
matched_text: &str,
) -> Result<Option<ValidatedFinding>>
pub async 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 async fn set(
&self,
repo_owner: &str,
repo_name: &str,
file_path: &str,
pattern_id: &str,
matched_text: &str,
validated: ValidatedFinding,
) -> Result<()>
pub async 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 UnsafeUnpin 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