mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
bc3b0fda35
This adds additional logging to the authentication logs such as type, remote IP, request method, redirect URL, and if the attempt was done during a ban. This also means we log attempts that occur when the attempt was blocked by the regulator for record keeping purposes, as well as record 2FA attempts which can be used to inform admins and later to regulate based on other factors. Fixes #116, Fixes #1293.
19 lines
527 B
Go
19 lines
527 B
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// AuthenticationAttempt represents an authentication attempt row in the database.
|
|
type AuthenticationAttempt struct {
|
|
ID int `db:"id"`
|
|
Time time.Time `db:"time"`
|
|
Successful bool `db:"successful"`
|
|
Banned bool `db:"banned"`
|
|
Username string `db:"username"`
|
|
Type string `db:"auth_type"`
|
|
RemoteIP IPAddress `db:"remote_ip"`
|
|
RequestURI string `db:"request_uri"`
|
|
RequestMethod string `db:"request_method"`
|
|
}
|