mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
ddea31193b
OpenID connect has become a standard when it comes to authentication and in order to fix a security concern around forwarding authentication and authorization information it has been decided to add support for it. This feature is in beta version and only enabled when there is a configuration for it. Before enabling it in production, please consider that it's in beta with potential bugs and that there are several production critical features still missing such as all OIDC related data is stored in configuration or memory. This means you are potentially going to experience issues with HA deployments, or when restarting a single instance specifically related to OIDC. We are still working on adding the remaining set of features before making it GA as soon as possible. Related to #189 Co-authored-by: Clement Michaud <clement.michaud34@gmail.com>
53 lines
1.4 KiB
Go
53 lines
1.4 KiB
Go
package utils
|
|
|
|
import (
|
|
"errors"
|
|
"regexp"
|
|
"time"
|
|
)
|
|
|
|
const (
|
|
windows = "windows"
|
|
testStringInput = "abcdefghijkl"
|
|
|
|
// RFC3339Zero is the default value for time.Time.Unix().
|
|
RFC3339Zero = int64(-62135596800)
|
|
|
|
// TLS13 is the textual representation of TLS 1.3.
|
|
TLS13 = "1.3"
|
|
|
|
// TLS12 is the textual representation of TLS 1.2.
|
|
TLS12 = "1.2"
|
|
|
|
// TLS11 is the textual representation of TLS 1.1.
|
|
TLS11 = "1.1"
|
|
|
|
// TLS10 is the textual representation of TLS 1.0.
|
|
TLS10 = "1.0"
|
|
|
|
// Hour is an int based representation of the time unit.
|
|
Hour = time.Minute * 60
|
|
|
|
// Day is an int based representation of the time unit.
|
|
Day = Hour * 24
|
|
|
|
// Week is an int based representation of the time unit.
|
|
Week = Day * 7
|
|
|
|
// Year is an int based representation of the time unit.
|
|
Year = Day * 365
|
|
|
|
// Month is an int based representation of the time unit.
|
|
Month = Year / 12
|
|
)
|
|
|
|
// ErrTimeoutReached error thrown when a timeout is reached.
|
|
var ErrTimeoutReached = errors.New("timeout reached")
|
|
var parseDurationRegexp = regexp.MustCompile(`^(?P<Duration>[1-9]\d*?)(?P<Unit>[smhdwMy])?$`)
|
|
|
|
// AlphaNumericCharacters are literally just valid alphanumeric chars.
|
|
var AlphaNumericCharacters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
|
|
|
|
// ErrTLSVersionNotSupported returned when an unknown TLS version supplied.
|
|
var ErrTLSVersionNotSupported = errors.New("supplied TLS version isn't supported")
|