Bucket
struct Bucket
A counter for one thing an attacker might guess against, with its own limit and counting window.
-
Declaration
Swift
let key: String -
Declaration
Swift
let limit: Int -
Seconds
Declaration
Swift
let window: Int -
Every kind of failed attempt from one client IP.
Declaration
Swift
static func clientIP(_ ip: String) -> Bucket -
Failed logins and password changes for one username from one client IP.
Declaration
Swift
static func usernameAndIP(_ username: String, _ ip: String) -> Bucket -
Failed logins and password changes for one username from all client IPs.
Declaration
Swift
static func username(_ username: String) -> Bucket -
Failed password recoveries for one username.
Declaration
Swift
static func recovery(_ username: String) -> Bucket -
Failed username lookups for one registration code.
Declaration
Swift
static func usernameLookup(_ registrationCode: String) -> Bucket -
The buckets for a login or password change attempt.
Declaration
Swift
static func login(_ username: String, ip: String) -> [Bucket]
View on GitHub