summaryrefslogtreecommitdiff
path: root/internal/handlers/const_test.go
blob: f1ab0d7df771b0c313ca5f1922715b7d67de5539 (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
52
53
54
55
56
57
package handlers

import (
	"net/url"
	"time"

	"github.com/valyala/fasthttp"
)

var (
	testRequestMethods = []string{
		fasthttp.MethodOptions, fasthttp.MethodHead, fasthttp.MethodGet,
		fasthttp.MethodDelete, fasthttp.MethodPatch, fasthttp.MethodPost,
		fasthttp.MethodPut, fasthttp.MethodConnect, fasthttp.MethodTrace,
	}

	testXHR = map[string]bool{
		testWithoutAccept: false,
		testWithXHRHeader: true,
	}
)

const (
	testXOriginalMethod = "X-Original-Method"
	testXOriginalUrl    = "X-Original-URL"
	testBypass          = "bypass"
	testWithoutAccept   = "WithoutAccept"
	testWithXHRHeader   = "WithXHRHeader"
)

const (
	testBASE32TOTPSecret = "JVHFEUBXJ5CUWN2GGZGDMTKSJNMEQN2YGRJUQM2OKRHECR2QKJGFGRSQJVEVUT2HII2FQSJTKNIVQSCPIJIQ====" //nolint:gosec // Test only credential.
)

const (
	testInactivity           = time.Second * 10
	testRedirectionURLString = "https://www.example.com"
	testUsername             = "john"
	testDisplayName          = "john"
	testEmail                = "john@example.com"
	exampleDotCom            = "example.com"
)

const (
	testValue = "test"
)

var (
	testRedirectionURL = func() *url.URL {
		u, err := url.ParseRequestURI(testRedirectionURLString)
		if err != nil {
			panic(err)
		}

		return u
	}()
)