Add placeholder middleware for guardian

This commit is contained in:
mStar aka a person 2024-01-29 17:11:26 +00:00
parent 5593efee37
commit c2ff5ac1fa

27
guardian/guardian.go Normal file
View file

@ -0,0 +1,27 @@
package guardian
import (
"net/http"
"gitlab.com/mstarongitlab/linstrom/config"
"gitlab.com/mstarongitlab/linstrom/storage"
)
type GuardianMiddleware struct {
nextHandler http.Handler
config *config.Config
storage *storage.Storage
}
func NewMiddleware(nextHandler http.Handler, cfg *config.Config, s *storage.Storage) *GuardianMiddleware {
return &GuardianMiddleware{
nextHandler: nextHandler,
config: cfg,
storage: s,
}
}
func (gm *GuardianMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// TODO: Add guardian filtering stuff here, see Planka
gm.nextHandler.ServeHTTP(w, r)
}