config: remove source, remove deadcode, fix linting issues (#4118)

* remove source, remove deadcode, fix linting issues

* use github action for lint

* fix missing envoy
This commit is contained in:
Caleb Doxsey 2023-04-21 17:25:11 -06:00 committed by GitHub
parent 34c1e44c7e
commit bbed421cd8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
122 changed files with 438 additions and 998 deletions

View file

@ -9,19 +9,19 @@ import (
func TestTokenFromHeader(t *testing.T) {
t.Run("pomerium header", func(t *testing.T) {
r, _ := http.NewRequest("GET", "http://localhost/some/url", nil)
r, _ := http.NewRequest(http.MethodGet, "http://localhost/some/url", nil)
r.Header.Set("X-Pomerium-Authorization", "JWT")
v := TokenFromHeaders(r)
assert.Equal(t, "JWT", v)
})
t.Run("pomerium type", func(t *testing.T) {
r, _ := http.NewRequest("GET", "http://localhost/some/url", nil)
r, _ := http.NewRequest(http.MethodGet, "http://localhost/some/url", nil)
r.Header.Set("Authorization", "Pomerium JWT")
v := TokenFromHeaders(r)
assert.Equal(t, "JWT", v)
})
t.Run("bearer type", func(t *testing.T) {
r, _ := http.NewRequest("GET", "http://localhost/some/url", nil)
r, _ := http.NewRequest(http.MethodGet, "http://localhost/some/url", nil)
r.Header.Set("Authorization", "Bearer Pomerium-JWT")
v := TokenFromHeaders(r)
assert.Equal(t, "JWT", v)