Skip to content
Snippets Groups Projects
Commit 63bce4d6 authored by Christian Pointner's avatar Christian Pointner
Browse files

some more refactoring

parent e173a2fc
No related branches found
No related tags found
No related merge requests found
......@@ -164,11 +164,11 @@ func listBackends(c *gin.Context) {
}
func disabled(c *gin.Context) {
code := http.StatusBadRequest
if c.Param("path") == "/backends" {
c.JSON(http.StatusNotFound, HTTPErrorResponse{"authentication is disabled"})
return
code = http.StatusNotFound
}
c.JSON(http.StatusBadRequest, HTTPErrorResponse{"authentication is disabled"})
c.JSON(code, HTTPErrorResponse{"authentication is disabled"})
}
func InstallHTTPHandler(r *gin.RouterGroup) {
......@@ -177,15 +177,18 @@ func InstallHTTPHandler(r *gin.RouterGroup) {
return
}
r.GET("/backends", listBackends)
backends := r.Group("/backends")
backends.GET("", listBackends)
r.POST("/session", newSession)
r.GET("/session", getSession)
r.DELETE("/session", deleteSession)
session := r.Group("/session")
session.POST("", newSession)
session.GET("", getSession)
session.DELETE("", deleteSession)
if auth.oidc != nil {
r.GET("/oidc/login", auth.oidc.Login)
r.GET("/oidc/callback", auth.oidc.Callback)
oidc := r.Group("/oidc")
oidc.GET("login", auth.oidc.Login)
oidc.GET("callback", auth.oidc.Callback)
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment