feature (sso): authentication middleware

This commit is contained in:
Mickael Kerjean
2021-12-24 02:41:40 +11:00
parent bed13a0bc8
commit e5800c6c3b
33 changed files with 876 additions and 193 deletions

View File

@ -84,3 +84,13 @@ func AdminBackend(ctx App, res http.ResponseWriter, req *http.Request) {
SendSuccessResultWithEtagAndGzip(res, req, backends)
return
}
func AdminAuthenticationMiddleware(ctx App, res http.ResponseWriter, req *http.Request) {
drivers := Hooks.All.AuthenticationMiddleware()
middlewares := make(map[string]Form, len(drivers))
for id, driver := range drivers {
middlewares[id] = driver.Setup()
}
SendSuccessResultWithEtagAndGzip(res, req, middlewares)
return
}