Skip to main content

CanaryService

Trait CanaryService 

Source
pub trait CanaryService {
    // Required methods
    fn embed_canary(
        &self,
        covers: Vec<CoverMedia>,
        embedder: &dyn EmbedTechnique,
    ) -> Result<(Vec<CoverMedia>, CanaryShard), CanaryError>;
    fn check_canary(&self, shard: &CanaryShard) -> bool;
}
Expand description

Canary shard tripwire port.

Required Methods§

Source

fn embed_canary( &self, covers: Vec<CoverMedia>, embedder: &dyn EmbedTechnique, ) -> Result<(Vec<CoverMedia>, CanaryShard), CanaryError>

Embed an additional canary shard in covers alongside the regular distribution.

Returns the modified covers and the CanaryShard to be planted in a honeypot location.

§Errors

Returns CanaryError::NoCovers or CanaryError::EmbedFailed.

Source

fn check_canary(&self, shard: &CanaryShard) -> bool

Return true if the shard’s notify URL is reachable, indicating the canary has been accessed.

Non-blocking check; returns false on network error.

Implementors§