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>
Этот коммит содержится в:
Miguel de la Cruz
2024-07-04 10:35:26 +02:00
коммит произвёл GitHub
родитель cc5e87ae24
Коммит 809ad4f76d
29 изменённых файлов: 1702 добавлений и 77 удалений

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

@@ -1281,10 +1281,6 @@
"id": "api.command_remote.hint",
"translation": "[action]"
},
{
"id": "api.command_remote.incorrect_password.error",
"translation": "Could not decrypt invitation. Incorrect password or corrupt invitation: {{.Error}}"
},
{
"id": "api.command_remote.invitation.help",
"translation": "Invitation from secure connection"
@@ -2144,6 +2140,10 @@
"id": "api.getUsersForReporting.invalid_team_filter",
"translation": "Invalid team id provided."
},
{
"id": "api.get_site_url_error",
"translation": "Could not get the instance site url"
},
{
"id": "api.image.get.app_error",
"translation": "Requested image url cannot be parsed."
@@ -2726,14 +2726,34 @@
"id": "api.reaction.save_reaction.user_id.app_error",
"translation": "You cannot save reaction for the other user."
},
{
"id": "api.remote_cluster.accept_invitation_error",
"translation": "Could not accept the remote cluster invitation"
},
{
"id": "api.remote_cluster.base64_decode_error",
"translation": "Could not decode the base64 string"
},
{
"id": "api.remote_cluster.cluster_not_deleted",
"translation": "Remote cluster has not been deleted"
},
{
"id": "api.remote_cluster.delete.app_error",
"translation": "We encountered an error deleting the secure connection."
},
{
"id": "api.remote_cluster.encrypt_invite_error",
"translation": "Could not encrypt the remote cluster invite using the provided password"
},
{
"id": "api.remote_cluster.get.app_error",
"translation": "We encountered an error retrieving a secure connection."
},
{
"id": "api.remote_cluster.get.not_found",
"translation": "Remote Cluster not found"
},
{
"id": "api.remote_cluster.invalid_id.app_error",
"translation": "Invalid id."
@@ -2742,6 +2762,10 @@
"id": "api.remote_cluster.invalid_topic.app_error",
"translation": "Invalid topic."
},
{
"id": "api.remote_cluster.invite_decrypt_error",
"translation": "Could not decrypt the remote cluster invite using the provided password"
},
{
"id": "api.remote_cluster.save.app_error",
"translation": "We encountered an error saving the secure connection."