2020-05-02 16:20:40 +00:00
|
|
|
package schema
|
|
|
|
|
2020-05-04 19:39:25 +00:00
|
|
|
import (
|
2022-07-05 04:43:12 +00:00
|
|
|
"regexp"
|
2020-05-04 19:39:25 +00:00
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2020-05-06 00:52:06 +00:00
|
|
|
const argon2id = "argon2id"
|
|
|
|
|
2020-05-04 19:39:25 +00:00
|
|
|
// ProfileRefreshDisabled represents a value for refresh_interval that disables the check entirely.
|
|
|
|
const ProfileRefreshDisabled = "disable"
|
|
|
|
|
2022-03-13 02:51:23 +00:00
|
|
|
const (
|
|
|
|
// ProfileRefreshAlways represents a value for refresh_interval that's the same as 0ms.
|
|
|
|
ProfileRefreshAlways = "always"
|
2020-05-04 19:39:25 +00:00
|
|
|
|
2022-03-13 02:51:23 +00:00
|
|
|
// RefreshIntervalDefault represents the default value of refresh_interval.
|
|
|
|
RefreshIntervalDefault = "5m"
|
2020-05-04 19:39:25 +00:00
|
|
|
|
2022-03-13 02:51:23 +00:00
|
|
|
// RefreshIntervalAlways represents the duration value refresh interval should have if set to always.
|
|
|
|
RefreshIntervalAlways = 0 * time.Millisecond
|
|
|
|
)
|
2020-11-27 09:59:22 +00:00
|
|
|
|
2022-03-13 02:51:23 +00:00
|
|
|
const (
|
|
|
|
// LDAPImplementationCustom is the string for the custom LDAP implementation.
|
|
|
|
LDAPImplementationCustom = "custom"
|
2020-11-27 09:59:22 +00:00
|
|
|
|
2022-03-13 02:51:23 +00:00
|
|
|
// LDAPImplementationActiveDirectory is the string for the Active Directory LDAP implementation.
|
|
|
|
LDAPImplementationActiveDirectory = "activedirectory"
|
|
|
|
)
|
2021-12-01 12:11:29 +00:00
|
|
|
|
|
|
|
// TOTP Algorithm.
|
|
|
|
const (
|
|
|
|
TOTPAlgorithmSHA1 = "SHA1"
|
|
|
|
TOTPAlgorithmSHA256 = "SHA256"
|
|
|
|
TOTPAlgorithmSHA512 = "SHA512"
|
|
|
|
)
|
|
|
|
|
2022-03-13 02:51:23 +00:00
|
|
|
const (
|
|
|
|
// RememberMeDisabled represents the duration for a disabled remember me session configuration.
|
|
|
|
RememberMeDisabled = time.Second * -1
|
|
|
|
)
|
|
|
|
|
2021-12-01 12:11:29 +00:00
|
|
|
var (
|
|
|
|
// TOTPPossibleAlgorithms is a list of valid TOTP Algorithms.
|
|
|
|
TOTPPossibleAlgorithms = []string{TOTPAlgorithmSHA1, TOTPAlgorithmSHA256, TOTPAlgorithmSHA512}
|
|
|
|
)
|
2022-04-07 23:01:01 +00:00
|
|
|
|
|
|
|
const (
|
|
|
|
// TOTPSecretSizeDefault is the default secret size.
|
|
|
|
TOTPSecretSizeDefault = 32
|
|
|
|
|
|
|
|
// TOTPSecretSizeMinimum is the minimum secret size.
|
|
|
|
TOTPSecretSizeMinimum = 20
|
|
|
|
)
|
2022-07-05 04:43:12 +00:00
|
|
|
|
|
|
|
// regexpHasScheme checks if a string has a scheme. Valid characters for schemes include alphanumeric, hyphen,
|
|
|
|
// period, and plus characters.
|
|
|
|
var regexpHasScheme = regexp.MustCompile(`^[-+.a-zA-Z\d]+://`)
|