2018-08-21 20:40:42 +02:00
|
|
|
package motd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/gorilla/mux"
|
2019-03-21 14:20:14 +13:00
|
|
|
"github.com/portainer/portainer/api/http/security"
|
2018-08-21 20:40:42 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
// Handler is the HTTP handler used to handle MOTD operations.
|
|
|
|
type Handler struct {
|
|
|
|
*mux.Router
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewHandler returns a new Handler
|
2023-06-16 10:44:22 -03:00
|
|
|
func NewHandler(bouncer security.BouncerService) *Handler {
|
2018-08-21 20:40:42 +02:00
|
|
|
h := &Handler{
|
|
|
|
Router: mux.NewRouter(),
|
|
|
|
}
|
|
|
|
h.Handle("/motd",
|
2019-10-07 16:10:51 +13:00
|
|
|
bouncer.RestrictedAccess(http.HandlerFunc(h.motd))).Methods(http.MethodGet)
|
2018-08-21 20:40:42 +02:00
|
|
|
|
|
|
|
return h
|
|
|
|
}
|