add log handler for auth proxy for debug purpose
@@ -448,13 +448,22 @@ func handleOIDCCallback(c echo.Context) error {
return c.Redirect(302, uri.String())
}
-func main() {
- e := server.NewEchoInstance()
+func handleLog(c echo.Context) error {
+ level := c.QueryParam("level")
- if os.Getenv("DEBUG") != "" {
+ switch level {
+ case "debug":
log.SetLevel(log.DebugLevel)
+ default:
+ log.SetLevel(log.InfoLevel)
+ }
+
+ return c.NoContent(200)
}
+func main() {
+ e := server.NewEchoInstance()
+
// oidc auth proxy handlers
e.GET("/oidc/login", handleOIDCLogin)
e.GET("/oidc/callback", handleOIDCCallback)
@@ -463,6 +472,8 @@ func main() {
e.GET("/"+ENVOY_EXT_AUTH_PATH_PREFIX+"/*", handleExtAuthz)
e.GET("/"+ENVOY_EXT_AUTH_PATH_PREFIX, handleExtAuthz)
+ e.POST("/log", handleLog)
+
e.Logger.Fatal(e.StartH2CServer("0.0.0.0:3002", &http2.Server{
MaxConcurrentStreams: 250,
MaxReadFrameSize: 1048576,
