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