#activity-pub #federation

apub-breaker-session

Utilities for building activitypub servers

2 unstable releases

0.2.0 Dec 5, 2021
0.1.0 Nov 30, 2021

#50 in #activity-pub


Used in apub

AGPL-3.0

57KB
1.5K SLoC

A Session implementation for limiting requests to domains that consistently fail

use apub_breaker_session::BreakerSession;
use std::time::Duration;

// Create a session that refuses requests for an hour after 10 consecutive failures to a given domain
let breaker_session = BreakerSession::limit(10, Duration::from_secs(60 * 60));

Dependencies

~1.5–2.5MB
~63K SLoC