Adds Remote Cluster related API endpoints (#27432)
* Adds Remote Cluster related API endpoints
New endpoints for the following routes are added:
- Get Remote Clusters at `GET /api/v4/remotecluster`
- Create Remote Cluster at `POST /api/v4/remotecluster`
- Accept Remote Cluster invite at `POST
/api/v4/remotecluster/accept_invite`
- Generate Remote Cluster invite at `POST
/api/v4/remotecluster/{remote_id}/generate_invite`
- Get Remote Cluster at `GET /api/v4/remotecluster/{remote_id}`
- Patch Remote Cluster at `PATCH /api/v4/remotecluster/{remote_id}`
- Delete Remote Cluster at `DELETE /api/v4/remotecluster/{remote_id}`
These endpoints are planned to be used from the system console, and
gated through the `manage_secure_connections` permission.
* Update server/channels/api4/remote_cluster_test.go
Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
* Fix AppError names
---------
Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
cc5e87ae24
Коммит
809ad4f76d
@@ -93,6 +93,14 @@ type Params struct {
|
||||
FilterHasMember string
|
||||
IncludeChannelMemberCount string
|
||||
OutgoingOAuthConnectionID string
|
||||
ExcludeOffline bool
|
||||
InChannel string
|
||||
NotInChannel string
|
||||
Topic string
|
||||
CreatorId string
|
||||
OnlyConfirmed bool
|
||||
OnlyPlugins bool
|
||||
ExcludePlugins bool
|
||||
|
||||
//Bookmarks
|
||||
ChannelBookmarkId string
|
||||
@@ -126,7 +134,11 @@ func ParamsFromRequest(r *http.Request) *Params {
|
||||
params.FileId = props["file_id"]
|
||||
params.Filename = query.Get("filename")
|
||||
params.UploadId = props["upload_id"]
|
||||
params.PluginId = props["plugin_id"]
|
||||
if val, ok := props["plugin_id"]; ok {
|
||||
params.PluginId = val
|
||||
} else {
|
||||
params.PluginId = query.Get("plugin_id")
|
||||
}
|
||||
params.CommandId = props["command_id"]
|
||||
params.HookId = props["hook_id"]
|
||||
params.ReportId = props["report_id"]
|
||||
@@ -150,6 +162,14 @@ func ParamsFromRequest(r *http.Request) *Params {
|
||||
params.RemoteId = props["remote_id"]
|
||||
params.InvoiceId = props["invoice_id"]
|
||||
params.OutgoingOAuthConnectionID = props["outgoing_oauth_connection_id"]
|
||||
params.ExcludeOffline, _ = strconv.ParseBool(query.Get("exclude_offline"))
|
||||
params.InChannel = query.Get("in_channel")
|
||||
params.NotInChannel = query.Get("not_in_channel")
|
||||
params.Topic = query.Get("topic")
|
||||
params.CreatorId = query.Get("creator_id")
|
||||
params.OnlyConfirmed, _ = strconv.ParseBool(query.Get("only_confirmed"))
|
||||
params.OnlyPlugins, _ = strconv.ParseBool(query.Get("only_plugins"))
|
||||
params.ExcludePlugins, _ = strconv.ParseBool(query.Get("exclude_plugins"))
|
||||
params.ChannelBookmarkId = props["bookmark_id"]
|
||||
params.Scope = query.Get("scope")
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user