mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
b4e570358e
* build: include major in go.mod module directive * fix: xflags * revert: cobra changes * fix: mock doc
25 lines
676 B
Go
25 lines
676 B
Go
package regulation
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/authelia/authelia/v4/internal/storage"
|
|
"github.com/authelia/authelia/v4/internal/utils"
|
|
)
|
|
|
|
// Regulator an authentication regulator preventing attackers to brute force the service.
|
|
type Regulator struct {
|
|
// Is the regulation enabled.
|
|
enabled bool
|
|
// The number of failed authentication attempt before banning the user
|
|
maxRetries int
|
|
// If a user does the max number of retries within that duration, she will be banned.
|
|
findTime time.Duration
|
|
// If a user has been banned, this duration is the timelapse during which the user is banned.
|
|
banTime time.Duration
|
|
|
|
storageProvider storage.Provider
|
|
|
|
clock utils.Clock
|
|
}
|