1
0
Fork 0

removed useless Method Middleware from the site

Dieser Commit ist enthalten in:
Sebastian Tobie 2021-01-10 15:14:47 +01:00
Ursprung f7b6593205
Commit 9dd2e49954
2 geänderte Dateien mit 4 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -82,7 +82,9 @@ func CreateServer(config *toml.Tree) *Server {
// Use installs the middleware into the router.
// The Middleware must be able to detect multiple calls byy itself. Deduplication is not performed.
func (s *Server) Use(m ...gin.HandlerFunc) { s.router.Use(m...) }
func (s *Server) Use(m ...gin.HandlerFunc) {
s.router.Use(m...)
}
// UseAuthBackend is the funćtion that sets the Handler for the authentication
func (s *Server) UseAuthBackend(a auth.AuthenticationHandler) {
@ -93,11 +95,10 @@ func (s *Server) UseAuthBackend(a auth.AuthenticationHandler) {
// The Middleware must be able to detect multiple calls byy itself. Deduplication is not performed.
type Site interface {
Init(*gin.RouterGroup)
Middleware() []gin.HandlerFunc
}
// RegisterSite adds an site to the engine as its own grouo
func (s *Server) RegisterSite(path string, site Site) {
site.Init(s.router.Group(path, site.Middleware()...))
site.Init(s.router.Group(path))
return
}

Datei anzeigen

@ -123,11 +123,6 @@ func (s *SAML) Init(router *gin.RouterGroup) {
router.POST("/acs", s.acsHF)
}
// Middleware returns the Required Middleware
func (s *SAML) Middleware() []gin.HandlerFunc {
return []gin.HandlerFunc{}
}
func (s *SAML) metadataHF(c *gin.Context) {
m := s.sp.Metadata()
log.Debug().Time("Validuntil", m.ValidUntil).Msg("SP MEtadata")