pub struct ApiKeyRecognizer;Expand description
Recognizes generic API keys and bearer-style tokens with nearby key context.
§Examples
use cloakrs_core::{EntityType, Recognizer};
use cloakrs_patterns::ApiKeyRecognizer;
let findings = ApiKeyRecognizer.scan("api_key = sk_live_0123456789abcdef");
assert_eq!(findings[0].entity_type, EntityType::ApiKey);Trait Implementations§
Source§impl Clone for ApiKeyRecognizer
impl Clone for ApiKeyRecognizer
Source§fn clone(&self) -> ApiKeyRecognizer
fn clone(&self) -> ApiKeyRecognizer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ApiKeyRecognizer
impl Debug for ApiKeyRecognizer
Source§impl Default for ApiKeyRecognizer
impl Default for ApiKeyRecognizer
Source§fn default() -> ApiKeyRecognizer
fn default() -> ApiKeyRecognizer
Returns the “default value” for a type. Read more
Source§impl Recognizer for ApiKeyRecognizer
impl Recognizer for ApiKeyRecognizer
Source§fn entity_type(&self) -> EntityType
fn entity_type(&self) -> EntityType
The entity type this recognizer detects.
Source§fn supported_locales(&self) -> &[Locale]
fn supported_locales(&self) -> &[Locale]
Locales this recognizer applies to. Empty means universal.
impl Copy for ApiKeyRecognizer
Auto Trait Implementations§
impl Freeze for ApiKeyRecognizer
impl RefUnwindSafe for ApiKeyRecognizer
impl Send for ApiKeyRecognizer
impl Sync for ApiKeyRecognizer
impl Unpin for ApiKeyRecognizer
impl UnsafeUnpin for ApiKeyRecognizer
impl UnwindSafe for ApiKeyRecognizer
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