mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-10 14:52:43 +02:00
proxy : add HTTP endpoint support (#13)
proxy : Add HTTP (insecure) endpoint support, closes #11. * Fix typos * Fixed additional typos and an ineffectual assignment * Update route configuration in docs
This commit is contained in:
parent
56c89e8653
commit
0766725ff8
10 changed files with 17 additions and 21 deletions
|
@ -32,10 +32,10 @@ func Test_validRedirectURI(t *testing.T) {
|
|||
}
|
||||
|
||||
func Test_validSignature(t *testing.T) {
|
||||
goodUrl := "https://example.com/redirect"
|
||||
goodURL := "https://example.com/redirect"
|
||||
secretA := "41aOD7VNtQ1/KZDCGrkYpaHwB50JC1y6BDs2KPRVd2A="
|
||||
now := fmt.Sprint(time.Now().Unix())
|
||||
rawSig := redirectURLSignature(goodUrl, time.Now(), secretA)
|
||||
rawSig := redirectURLSignature(goodURL, time.Now(), secretA)
|
||||
sig := base64.URLEncoding.EncodeToString(rawSig)
|
||||
staleTime := fmt.Sprint(time.Now().Add(-6 * time.Minute).Unix())
|
||||
|
||||
|
@ -47,12 +47,12 @@ func Test_validSignature(t *testing.T) {
|
|||
secret string
|
||||
want bool
|
||||
}{
|
||||
{"good signature", goodUrl, string(sig), now, secretA, true},
|
||||
{"good signature", goodURL, string(sig), now, secretA, true},
|
||||
{"empty redirect url", "", string(sig), now, secretA, false},
|
||||
{"bad redirect url", "https://google.com^", string(sig), now, secretA, false},
|
||||
{"malformed signature", goodUrl, string(sig + "^"), now, "&*&@**($&#(", false},
|
||||
{"malformed timestamp", goodUrl, string(sig), now + "^", secretA, false},
|
||||
{"stale timestamp", goodUrl, string(sig), staleTime, secretA, false},
|
||||
{"malformed signature", goodURL, string(sig + "^"), now, "&*&@**($&#(", false},
|
||||
{"malformed timestamp", goodURL, string(sig), now + "^", secretA, false},
|
||||
{"stale timestamp", goodURL, string(sig), staleTime, secretA, false},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue