2022-10-17 10:51:59 +00:00
|
|
|
package validator
|
|
|
|
|
2023-05-07 06:39:17 +00:00
|
|
|
import (
|
|
|
|
"github.com/authelia/authelia/v4/internal/configuration/schema"
|
|
|
|
)
|
|
|
|
|
2022-10-17 10:51:59 +00:00
|
|
|
// Test constants.
|
|
|
|
const (
|
|
|
|
testInvalid = "invalid"
|
|
|
|
testJWTSecret = "a_secret"
|
|
|
|
testLDAPBaseDN = "base_dn"
|
|
|
|
testLDAPPassword = "password"
|
|
|
|
testLDAPURL = "ldap://ldap"
|
|
|
|
testLDAPUser = "user"
|
|
|
|
testEncryptionKey = "a_not_so_secure_encryption_key"
|
2023-06-18 04:40:38 +00:00
|
|
|
|
|
|
|
member = "member"
|
|
|
|
memberof = "memberof"
|
|
|
|
memberOf = "memberOf"
|
|
|
|
filterMemberOfRDN = "(|({memberof:rdn}))"
|
2022-10-17 10:51:59 +00:00
|
|
|
)
|
2022-10-21 08:41:33 +00:00
|
|
|
|
|
|
|
const (
|
2023-01-12 10:57:44 +00:00
|
|
|
exampleDotCom = "example.com"
|
2023-05-15 00:32:10 +00:00
|
|
|
rs256 = "rs256"
|
2022-10-21 08:41:33 +00:00
|
|
|
)
|
2023-05-07 05:48:26 +00:00
|
|
|
|
|
|
|
const (
|
|
|
|
local25 = "127.0.0.25"
|
|
|
|
)
|
2023-05-07 06:39:17 +00:00
|
|
|
|
|
|
|
var (
|
|
|
|
testLDAPAddress = MustParseAddressPtr(testLDAPURL)
|
|
|
|
)
|
|
|
|
|
|
|
|
func MustParseAddressPtr(input string) *schema.Address {
|
|
|
|
address, err := schema.NewAddress(input)
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
return address
|
|
|
|
}
|
|
|
|
|
|
|
|
func MustParseAddress(input string) schema.Address {
|
|
|
|
address, err := schema.NewAddress(input)
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
return *address
|
|
|
|
}
|