MM-24847 MM-24484 MM-24850 MM-24849 - local mode for commands (#14571)

* add unix socket listener for mmctl local mode

* First working PoC

* Adds the channel list endpoint

* Add team list endpoint

* Add a LocalClient to the api test helper and start local mode

* Add helper to test with both SystemAdmin and Local clients

* Add some docs

* Adds TestForAllClients test helper

* Incorporating @ashishbhate's proposal for adding test names to the helpers

* [MM-24146] Add unix socket listener for mmctl local mode (#14296)

* add unix socket listener for mmctl local mode

* add a constant for local-mode socket path

* reflect review comments

* Fix init errors after merge

* Adds create channel tests

* Always init local mode to allow for enabling-disabling it via config

* Check the RemoteAddr of the request before marking session as local

* Mark the request as errored if it's local and the origin is remote

* Set the socket permissions to read/write when initialising

* Fix linter

* Replace RemoteAddr check to ditch connections with the IP:PORT shape

* added update/move/get/delete command in local mode

* merge fix

* .

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
Co-authored-by: Miguel de la Cruz <miguel@mcrx.me>
Этот коммит содержится в:
Eli Yukelzon
2020-05-31 17:57:04 +03:00
коммит произвёл GitHub
родитель d1788cab85
Коммит 2af00f73c0
4 изменённых файлов: 88 добавлений и 82 удалений

Просмотреть файл

@@ -13,6 +13,11 @@ import (
func (api *API) InitCommandLocal() {
api.BaseRoutes.Commands.Handle("", api.ApiLocal(localCreateCommand)).Methods("POST")
api.BaseRoutes.Commands.Handle("", api.ApiLocal(listCommands)).Methods("GET")
api.BaseRoutes.Command.Handle("", api.ApiLocal(getCommand)).Methods("GET")
api.BaseRoutes.Command.Handle("", api.ApiLocal(updateCommand)).Methods("PUT")
api.BaseRoutes.Command.Handle("/move", api.ApiLocal(moveCommand)).Methods("PUT")
api.BaseRoutes.Command.Handle("", api.ApiLocal(deleteCommand)).Methods("DELETE")
}
func localCreateCommand(c *Context, w http.ResponseWriter, r *http.Request) {