Add fallback authentication through Kerberos
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
4c46386fff
commit
9807eeec1a
8 changed files with 132 additions and 5 deletions
11
auth.go
11
auth.go
|
@ -9,8 +9,19 @@ import (
|
|||
"github.com/julienschmidt/httprouter"
|
||||
)
|
||||
|
||||
var LocalAuthFunc = checkAuthKrb5
|
||||
var localAuthUsers arrayFlags
|
||||
|
||||
type loginForm struct {
|
||||
Login string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
router.GET("/api/auth", apiAuthHandler(validateAuthToken))
|
||||
router.POST("/api/auth", apiRawHandler(func(w http.ResponseWriter, ps httprouter.Params, body []byte) HTTPResponse {
|
||||
return formatApiResponse(LocalAuthFunc(w, ps, body))
|
||||
}))
|
||||
router.POST("/api/auth/logout", apiRawHandler(logout))
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue