added new basic auth endpoint

This commit is contained in:
ston1th 2022-08-21 14:59:31 +02:00
commit 8c9ab3b8d2
10 changed files with 249 additions and 51 deletions

View file

@ -28,9 +28,10 @@ type Server struct {
srv *http.Server
API *client.APIClient
DB *db.DB
JWT *jwt.JWT
API *client.APIClient
DB *db.DB
JWT *jwt.JWT
BasicAuth *BasicAuth
ts *TemplateStore
}
@ -72,6 +73,10 @@ func (s *Server) Start(dblog logr.Logger) (err error) {
if err != nil {
return errors.New("server: " + err.Error())
}
s.BasicAuth, err = NewBasicAuth(NewDBLoginValidator(s.DB))
if err != nil {
return errors.New("server: " + err.Error())
}
go func() {
time.Sleep(time.Second * 2)
s.srv.ListenAndServe()