RateLimiterConfig class

Limits attempts for each string key within a domain and source.

Constructors

RateLimiterConfig({required String domain, required String source, required int maxAttempts, Duration? timeframe, Map<String, String>? defaultExtraData, Future<void> onRateLimitExceeded(Session session, String key)?})
Creates the configuration for a RateLimiter.

Properties

defaultExtraData → Map<String, String>?
Metadata included with each admitted attempt. Per-attempt values override defaults with the same name.
final
domain → String
Namespace for the provider, such as email or anonymous.
final
hashCode → int
The hash code for this object.
no setterinherited
maxAttempts → int
Maximum number of admitted attempts per key. Must be positive.
final
onRateLimitExceeded → Future<void> Function(Session session, String key)?
Called for each rejected attempt, after the limiter transaction ends.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
source → String
Operation within the domain, such as failed_login.
final
timeframe → Duration?
Rolling window for counting attempts. If omitted, all attempts count. Must be positive when provided.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited