Restructured authmiddleware fn and added tests (#2410)

* Created separate file for authmiddleware fn
* Optimize auth login and middleware
* Added unittests for authmiddleware
* Fixed authURL
* Removed featureConfig as global variable
* Fix integration test according to examples repo changes
* Fix integration test path for go module-example

Co-authored-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
Ankit Chawla
2022-04-22 14:21:58 +05:30
committed by GitHub
co-authored by Sanket Sudake
parent b98538ba24
commit 90c479b23c
13 changed files with 373 additions and 201 deletions
+2 -2
View File
@@ -70,7 +70,7 @@ func TestMutableMux(t *testing.T) {
// make a simple mutable router
log.Print("Create mutable router")
muxRouter := mux.NewRouter()
muxRouter.Use(metrics.HTTPMetricMiddleware())
muxRouter.Use(metrics.HTTPMetricMiddleware)
muxRouter.HandleFunc("/", OldHandler)
config := zap.NewDevelopmentConfig()
config.EncoderConfig.EncodeTime = zapcore.ISO8601TimeEncoder
@@ -97,7 +97,7 @@ func TestMutableMux(t *testing.T) {
// change the muxer
log.Print("Change mux router")
newMuxRouter := mux.NewRouter()
newMuxRouter.Use(metrics.HTTPMetricMiddleware())
newMuxRouter.Use(metrics.HTTPMetricMiddleware)
newMuxRouter.HandleFunc("/", NewHandler)
mr.updateRouter(newMuxRouter)