all: remove unused handler code (#2439)

* - Remove unused middleware

Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>

* remove unused func weightedStrings

Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>

* remove unused func getJWTSetCookieHeaders

Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>

* Fix test name
This commit is contained in:
bobby 2021-08-16 13:04:39 -07:00 committed by GitHub
parent 87c9ace12c
commit 87c3c675d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 2 additions and 413 deletions

View file

@ -2,7 +2,6 @@ package authorize
import (
"net/url"
"regexp"
"testing"
envoy_service_auth_v3 "github.com/envoyproxy/go-control-plane/envoy/service/auth/v3"
@ -45,31 +44,6 @@ func TestLoadSession(t *testing.T) {
return &state, nil
}
t.Run("cookie", func(t *testing.T) {
cookieStore, err := getCookieStore(opts, encoder)
if !assert.NoError(t, err) {
return
}
hdrs, err := getJWTSetCookieHeaders(cookieStore, rawjwt)
if !assert.NoError(t, err) {
return
}
cookie := regexp.MustCompile(`^([^;]+)(;.*)?$`).ReplaceAllString(hdrs["Set-Cookie"], "$1")
hattrs := &envoy_service_auth_v3.AttributeContext_HttpRequest{
Id: "req-1",
Method: "GET",
Headers: map[string]string{
"Cookie": cookie,
},
Path: "/hello/world",
Host: "example.com",
Scheme: "https",
}
sess, err := load(t, hattrs)
assert.NoError(t, err)
assert.NotNil(t, sess)
})
t.Run("header", func(t *testing.T) {
hattrs := &envoy_service_auth_v3.AttributeContext_HttpRequest{
Id: "req-1",