diff --git a/management/server/http/peers_handler.go b/management/server/http/peers_handler.go index a0bf09b7b..76c4f7502 100644 --- a/management/server/http/peers_handler.go +++ b/management/server/http/peers_handler.go @@ -69,6 +69,7 @@ func (h *PeersHandler) deletePeer(accountID, userID string, peerID string, w htt util.WriteJSONObject(w, "") } +// HandlePeer handles all peer requests for GET, PUT and DELETE operations func (h *PeersHandler) HandlePeer(w http.ResponseWriter, r *http.Request) { claims := h.claimsExtractor.FromRequestContext(r) account, user, err := h.accountManager.GetAccountFromToken(claims) @@ -98,6 +99,7 @@ func (h *PeersHandler) HandlePeer(w http.ResponseWriter, r *http.Request) { } } +// GetAllPeers returns a list of all peers associated with a provided account func (h *PeersHandler) GetAllPeers(w http.ResponseWriter, r *http.Request) { switch r.Method { case http.MethodGet: diff --git a/management/server/http/users_handler.go b/management/server/http/users_handler.go index 848c3ee50..5dae50dec 100644 --- a/management/server/http/users_handler.go +++ b/management/server/http/users_handler.go @@ -14,6 +14,7 @@ import ( "github.com/netbirdio/netbird/management/server/jwtclaims" ) +// UsersHandler is a handler that returns users of the account type UsersHandler struct { accountManager server.AccountManager claimsExtractor *jwtclaims.ClaimsExtractor