removed useless Method Middleware from the site
Dieser Commit ist enthalten in:
Ursprung
f7b6593205
Commit
9dd2e49954
7
http.go
7
http.go
|
@ -82,7 +82,9 @@ func CreateServer(config *toml.Tree) *Server {
|
||||||
|
|
||||||
// Use installs the middleware into the router.
|
// Use installs the middleware into the router.
|
||||||
// The Middleware must be able to detect multiple calls byy itself. Deduplication is not performed.
|
// 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
|
// UseAuthBackend is the funćtion that sets the Handler for the authentication
|
||||||
func (s *Server) UseAuthBackend(a auth.AuthenticationHandler) {
|
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.
|
// The Middleware must be able to detect multiple calls byy itself. Deduplication is not performed.
|
||||||
type Site interface {
|
type Site interface {
|
||||||
Init(*gin.RouterGroup)
|
Init(*gin.RouterGroup)
|
||||||
Middleware() []gin.HandlerFunc
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// RegisterSite adds an site to the engine as its own grouo
|
// RegisterSite adds an site to the engine as its own grouo
|
||||||
func (s *Server) RegisterSite(path string, site Site) {
|
func (s *Server) RegisterSite(path string, site Site) {
|
||||||
site.Init(s.router.Group(path, site.Middleware()...))
|
site.Init(s.router.Group(path))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,11 +123,6 @@ func (s *SAML) Init(router *gin.RouterGroup) {
|
||||||
router.POST("/acs", s.acsHF)
|
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) {
|
func (s *SAML) metadataHF(c *gin.Context) {
|
||||||
m := s.sp.Metadata()
|
m := s.sp.Metadata()
|
||||||
log.Debug().Time("Validuntil", m.ValidUntil).Msg("SP MEtadata")
|
log.Debug().Time("Validuntil", m.ValidUntil).Msg("SP MEtadata")
|
||||||
|
|
Laden…
In neuem Issue referenzieren