diff options
Diffstat (limited to 'test/integration/oidc.go')
| -rw-r--r-- | test/integration/oidc.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/integration/oidc.go b/test/integration/oidc.go new file mode 100644 index 0000000..9fa465e --- /dev/null +++ b/test/integration/oidc.go @@ -0,0 +1,23 @@ +package test + +import ( + "net/http" + "testing" + + "github.com/oauth2-proxy/mockoidc" + "github.com/stretchr/testify/require" +) + +func NewOIDCTestServer(t *testing.T) *mockoidc.MockOIDC { + srv, err := mockoidc.Run() + require.NoError(t, err) + + srv.AddMiddleware(func(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + t.Logf("%v %v %v\n", r.Method, r.URL.Path, r.URL.Query()) + next.ServeHTTP(w, r) + }) + }) + + return srv +} |
