diff options
| author | Clement Michaud <clement.michaud34@gmail.com> | 2019-11-17 11:47:07 +0100 |
|---|---|---|
| committer | Clément Michaud <clement.michaud34@gmail.com> | 2019-11-17 16:30:33 +0100 |
| commit | 3b2d733367c88621e4178301f2bcb4bc03613eee (patch) | |
| tree | 41ac41fc5b6cece04db85a08bfa7c32a022f7354 /internal/handlers/const.go | |
| parent | a06b69dd458e756f1a3d6867eb5b9f54560e2ee1 (diff) | |
Move source code into internal directory to follow standard project layout.
https://github.com/golang-standards/project-layout
Diffstat (limited to 'internal/handlers/const.go')
| -rw-r--r-- | internal/handlers/const.go | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/internal/handlers/const.go b/internal/handlers/const.go new file mode 100644 index 000000000..844f56ad0 --- /dev/null +++ b/internal/handlers/const.go @@ -0,0 +1,36 @@ +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 " + +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." +const unableToRegisterSecurityKeyMessage = "Unable to register your security key." +const unableToResetPasswordMessage = "Unable to reset your password." +const mfaValidationFailedMessage = "Authentication failed, please retry later." +const badBasicAuthFormatMessage = "Content of Proxy-Authorization header is wrong." |
