summaryrefslogtreecommitdiff
path: root/internal/configuration/validator/const_test.go
blob: 36a56ecf2718065a4d1fd32b17967ac2d3c3b4da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package validator

import (
	"github.com/authelia/authelia/v4/internal/configuration/schema"
)

// Test constants.
const (
	id = "id"

	testInvalid       = "invalid"
	testJWTSecret     = "a_secret"
	testLDAPBaseDN    = "base_dn"
	testLDAPPassword  = "password"
	testLDAPURL       = "ldap://ldap"
	testLDAPUser      = "user"
	testEncryptionKey = "a_not_so_secure_encryption_key"

	member            = "member"
	memberof          = "memberof"
	memberOf          = "memberOf"
	filterMemberOfRDN = "(|({memberof:rdn}))"
)

const (
	authdot       = "auth."
	exampleDotCom = "example.com"
	rs256         = "rs256"
)

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
}