Documentation ¶
Index ¶
- Variables
- func Register(r *mux.Router, opt *Options)
- type AuthChecker
- type Handler
- func (h *Handler) CreateSession(rw http.ResponseWriter, r *http.Request)
- func (h *Handler) DeleteSession(rw http.ResponseWriter, r *http.Request)
- func (h *Handler) GetAgentMsh(rw http.ResponseWriter, r *http.Request)
- func (h *Handler) Home(rw http.ResponseWriter, r *http.Request)
- func (h *Handler) ListSessions(rw http.ResponseWriter, r *http.Request)
- func (h *Handler) Pair(rw http.ResponseWriter, r *http.Request)
- func (h *Handler) ProxyAgent(rw http.ResponseWriter, r *http.Request)
- func (h *Handler) ProxyMeshCentral() http.Handler
- func (h *Handler) ProxyMeshCentralURL() string
- func (h *Handler) ProxyRelay(rw http.ResponseWriter, r *http.Request)
- func (h *Handler) ShareSession(rw http.ResponseWriter, r *http.Request)
- func (h *Handler) ShareSessionURL(rw http.ResponseWriter, r *http.Request)
- type Options
- type Request
- type Response
- type Session
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnableToPair = errors.New("unable to pair") ErrMissingSupporterInfo = errors.New("missing supporter info") )
Functions ¶
Types ¶
type AuthChecker ¶ added in v0.0.5
type AuthChecker func(rw http.ResponseWriter, r *http.Request) bool
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func (*Handler) CreateSession ¶
func (h *Handler) CreateSession(rw http.ResponseWriter, r *http.Request)
CreateSession godoc @Summary Create a session. @Description Create a plexus session where meshagents can connect to. @Tags session @Accept application/x-www-form-urlencoded @Produce application/json @Param id formData string true "session id" @Param ttl formData int true "the time to live for the session" @Param username formData string true "the credentials to open the remote control interface & delete the session" @Param password formData string true "the credentials to open the remote control interface & delete the session" @Param supporter_name formData string true "the supporter name" @Param supporter_avatar formData string true "the supporter avatar" @Success 200 {object} api.Session @Failure 400 {object} api.Error @Failure 500 {object} api.Error @Failure 502 {object} api.Error @Router /session [post]
func (*Handler) DeleteSession ¶
func (h *Handler) DeleteSession(rw http.ResponseWriter, r *http.Request)
DeleteSession godoc @Summary Delete a session. @Tags session @Produce application/json @Param id path string true "session id" @Security BasicAuth @Success 200 {object} api.Result @Failure 400 {object} api.Error @Failure 500 {object} api.Error @Failure 502 {object} api.Error @Router /session/{id} [delete]
func (*Handler) GetAgentMsh ¶
func (h *Handler) GetAgentMsh(rw http.ResponseWriter, r *http.Request)
GetAgentMsh godoc @Summary Gets the meshagent.msh for the given session. @Tags session @Produce text/plain @Param id path string true "session id" @Param token path string true "auth token" @Success 200 {object} string @Failure 400 {object} string @Failure 401 {object} string @Failure 404 {object} string @Failure 500 {object} string @Router /config/{id}:{token} [get]
func (*Handler) Home ¶ added in v0.0.6
func (h *Handler) Home(rw http.ResponseWriter, r *http.Request)
func (*Handler) ListSessions ¶ added in v0.0.5
func (h *Handler) ListSessions(rw http.ResponseWriter, r *http.Request)
ListSessions godoc @Summary Lists all active session. @Tags session @Produce application/json @Success 200 {array} api.Session @Failure 400 {object} api.Error @Failure 401 {object} api.Error @Failure 500 {object} api.Error @Router /session [get]
func (*Handler) Pair ¶ added in v0.0.6
func (h *Handler) Pair(rw http.ResponseWriter, r *http.Request)
Pair godoc @Summary Gets the pairing code info. @Tags session @Produce application/json @Param code path string true "code" @Security BasicAuth @Success 200 {object} api.URLResponse @Failure 401 {object} api.Error @Failure 404 {object} api.Error @Router /pairing/{code} [get]
func (*Handler) ProxyAgent ¶
func (h *Handler) ProxyAgent(rw http.ResponseWriter, r *http.Request)
ProxyAgent godoc @Summary Forwards the agent control requests to the meshcentral server @Tags websocket @Param id path string true "session id" @Param token path string true "the authentication token" @Success 200 {object} string @Router /agent/{id}:{token} [get]
func (*Handler) ProxyMeshCentral ¶ added in v0.0.3
func (*Handler) ProxyMeshCentralURL ¶ added in v0.0.3
func (*Handler) ProxyRelay ¶
func (h *Handler) ProxyRelay(rw http.ResponseWriter, r *http.Request)
ProxyRelay godoc @Summary Forwards meshagent relay requests to the meshcentral server. @Tags websocket @Success 200 {object} string @Router /meshrelay.ashx [get]
func (*Handler) ShareSession ¶
func (h *Handler) ShareSession(rw http.ResponseWriter, r *http.Request)
ShareSession godoc @Summary Start the remote control on the session via a browser. @Tags session @Produce text/html @Param id path string true "session id" @Security BasicAuth @Success 200 {object} string @Failure 400 {object} api.Error @Failure 401 {object} api.Error @Failure 500 {object} api.Error @Router /session/{id} [get]
func (*Handler) ShareSessionURL ¶
func (h *Handler) ShareSessionURL(rw http.ResponseWriter, r *http.Request)
ShareSessionURL godoc @Summary Gets the meshcentral share session for the session id. @Tags session @Produce application/json @Param id path string true "session id" @Security BasicAuth @Success 200 {object} api.URLResponse @Failure 400 {object} api.Error @Failure 401 {object} api.Error @Failure 500 {object} api.Error @Failure 502 {object} api.Error @Router /session/{id}/url [get]
type Options ¶ added in v0.0.5
type Options struct { ControlConfig *control.Config PairingConfig *config.PairingConfig Log logger.Logger Auth AuthChecker Prefix string AllowSessionCredentials bool }