pub struct ProgressionManager { /* private fields */ }Expand description
Progressive challenge escalation manager
Implementations§
Source§impl ProgressionManager
impl ProgressionManager
Sourcepub fn new(
cookie_manager: Arc<CookieManager>,
js_manager: Arc<JsChallengeManager>,
captcha_manager: Arc<CaptchaManager>,
tarpit_manager: Arc<TarpitManager>,
config: ProgressionConfig,
) -> Self
pub fn new( cookie_manager: Arc<CookieManager>, js_manager: Arc<JsChallengeManager>, captcha_manager: Arc<CaptchaManager>, tarpit_manager: Arc<TarpitManager>, config: ProgressionConfig, ) -> Self
Create a new progression manager
Sourcepub fn config(&self) -> &ProgressionConfig
pub fn config(&self) -> &ProgressionConfig
Get configuration
Sourcepub fn stats(&self) -> &ProgressionStats
pub fn stats(&self) -> &ProgressionStats
Get current statistics
Sourcepub fn get_challenge(
&self,
actor_id: &str,
risk_score: f64,
) -> ChallengeResponse
pub fn get_challenge( &self, actor_id: &str, risk_score: f64, ) -> ChallengeResponse
Get appropriate challenge for actor based on risk score and history
Sourcepub fn record_failure(&self, actor_id: &str)
pub fn record_failure(&self, actor_id: &str)
Record a failed challenge attempt
Sourcepub fn record_success(&self, actor_id: &str)
pub fn record_success(&self, actor_id: &str)
Record a successful challenge completion
Sourcepub fn escalate(&self, actor_id: &str) -> ChallengeLevel
pub fn escalate(&self, actor_id: &str) -> ChallengeLevel
Manually escalate an actor
Sourcepub fn de_escalate(&self, actor_id: &str) -> ChallengeLevel
pub fn de_escalate(&self, actor_id: &str) -> ChallengeLevel
Manually de-escalate an actor
Sourcepub fn get_level(&self, actor_id: &str) -> ChallengeLevel
pub fn get_level(&self, actor_id: &str) -> ChallengeLevel
Get current level for actor
Sourcepub fn get_actor_state(&self, actor_id: &str) -> Option<ActorChallengeState>
pub fn get_actor_state(&self, actor_id: &str) -> Option<ActorChallengeState>
Get actor state
Sourcepub fn list_actors_at_level(
&self,
level: ChallengeLevel,
) -> Vec<ActorChallengeState>
pub fn list_actors_at_level( &self, level: ChallengeLevel, ) -> Vec<ActorChallengeState>
List actors at a specific challenge level
Sourcepub fn list_all_actors(&self) -> Vec<ActorChallengeState>
pub fn list_all_actors(&self) -> Vec<ActorChallengeState>
List all tracked actors
Sourcepub fn start_background_tasks(self: Arc<Self>)
pub fn start_background_tasks(self: Arc<Self>)
Start background tasks (de-escalation, cleanup)
Spawns a background task that periodically runs maintenance.
The task will exit cleanly when shutdown() is called.
Sourcepub fn shutdown(&self)
pub fn shutdown(&self)
Signal shutdown for background tasks.
This method signals the background maintenance task to stop. The task will exit after completing any in-progress work.
Sourcepub fn run_maintenance(&self)
pub fn run_maintenance(&self)
Run maintenance tasks (de-escalation, cleanup)
Get cookie challenge name for validation.
Sourcepub fn validate_challenge(
&self,
actor_id: &str,
response: &str,
) -> ValidationResult
pub fn validate_challenge( &self, actor_id: &str, response: &str, ) -> ValidationResult
Validate a challenge response for an actor
Auto Trait Implementations§
impl !Freeze for ProgressionManager
impl !RefUnwindSafe for ProgressionManager
impl Send for ProgressionManager
impl Sync for ProgressionManager
impl Unpin for ProgressionManager
impl UnsafeUnpin for ProgressionManager
impl !UnwindSafe for ProgressionManager
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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>
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>
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