mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
469daedd36
* adaptively delay 1FA by the actual execution time of authentication * should grow and shrink over time as successful attempts are made * uses the average of the last 10 successful attempts to calculate * starts at an average of 1000ms * minimum is 250ms * a random delay is added to the largest of avg or minimum * the random delay is between 0ms and 85ms * bump LDAP suite to 80s timeout * bump regulation scenario to 45s * add mutex locking * amend logging * add docs * add tests Co-authored-by: Clément Michaud <clement.michaud34@gmail.com>
46 lines
1.9 KiB
Go
46 lines
1.9 KiB
Go
package handlers
|
|
|
|
// TOTPRegistrationAction is the string representation of the action for which the token has been produced.
|
|
const TOTPRegistrationAction = "RegisterTOTPDevice"
|
|
|
|
// U2FRegistrationAction is the string representation of the action for which the token has been produced.
|
|
const U2FRegistrationAction = "RegisterU2FDevice"
|
|
|
|
// ResetPasswordAction is the string representation of the action for which the token has been produced.
|
|
const ResetPasswordAction = "ResetPassword"
|
|
|
|
const authPrefix = "Basic "
|
|
|
|
// AuthorizationHeader is the basic-auth HTTP header Authelia utilises.
|
|
const AuthorizationHeader = "Proxy-Authorization"
|
|
const remoteUserHeader = "Remote-User"
|
|
const remoteGroupsHeader = "Remote-Groups"
|
|
|
|
var protoHostSeparator = []byte("://")
|
|
|
|
const (
|
|
// Forbidden means the user is forbidden the access to a resource.
|
|
Forbidden authorizationMatching = iota
|
|
// NotAuthorized means the user can access the resource with more permissions.
|
|
NotAuthorized authorizationMatching = iota
|
|
// Authorized means the user is authorized given her current permissions.
|
|
Authorized authorizationMatching = iota
|
|
)
|
|
|
|
const operationFailedMessage = "Operation failed."
|
|
const authenticationFailedMessage = "Authentication failed. Check your credentials."
|
|
const userBannedMessage = "Please retry in a few minutes."
|
|
const unableToRegisterOneTimePasswordMessage = "Unable to set up one-time passwords." //nolint:gosec
|
|
const unableToRegisterSecurityKeyMessage = "Unable to register your security key."
|
|
const unableToResetPasswordMessage = "Unable to reset your password."
|
|
const mfaValidationFailedMessage = "Authentication failed, please retry later."
|
|
|
|
const testInactivity = "10"
|
|
const testRedirectionURL = "http://redirection.local"
|
|
const testResultAllow = "allow"
|
|
const testUsername = "john"
|
|
|
|
const movingAverageWindow = 10
|
|
const msMinimumDelay1FA = float64(250)
|
|
const msMaximumRandomDelay = int64(85)
|