* 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>
* Sanitize RemoteEmail user prop
If the server is configured to hide user emails, the "RemoteEmail"
user property will be sanitized as well, effectively hiding the real
email of remote users.
* fix merge conflict
---------
Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
Co-authored-by: Mattermost Build <build@mattermost.com>
* update for adding multiple members
* fix unit test
* more test fixes
* add another unit test
* fix object passed by client4
* revert package-lock.json
* revert package-lock.json
* add length check
* limit size of lists in API requests
* revert package-lock
* add batching to front end
* add batching to front end
* fix bad merge
* update return type
* remove unnecessary permisssion check, add unit test
* fixes and add tests from review
* revert changes adding limits to other apis
* fixes
* clean-up from code review
* fix unit test call
* revert back to interface{}, fix unit test
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* added download system logs
* download all logs
* download all logs check-lint fix
* check lint fix
* download logs api
* download logs api working
* download logs working with error log
* linting issues and code cleanup
* CI check fix
* documented the api and logs from file with error handling
* test and final changes done
* final changes done
* Fix order of server-side translations
* Fix incorrect indentation of logs.yaml
---------
Co-authored-by: Harrison Healey <harrisonmhealey@gmail.com>
* Marks the RemoteTeamId field of RemoteClusters as deprecated
The `RemoteTeamId` was used both in the `RemoteCluster` model and as
part of remote invites. It existed so two different remotes could have
multiple secure connections between them, and have each of those
connections scoped to a team, sharing through each only the channels
that belong to their corresponding team.
The way that we're thinking on the feature currently only contemplates
one secure connection between two servers, and shares all the
channels through that secure connection, so this field is no longer
needed.
As we don't have a system in place for the user to choose in which
team a channel should be created from an invite, this change adds a
mechanism that checks the invite for a teamId, and if it's not
present, fetches a team from the database to create the channel
into. This makes the change backwards compatible for secure
connections that already have an established behavior and allows us to
move forward with the implementation of an alternative.
* Mark invite teamId field as deprecated
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* mm-57988: Allowing for channel admins to move thread
* Fix the MoveThread team admin unit test that was introduced
* Renaming the hasPermittedRole function to hasPermittedWranglerRole
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* Rewrite static assets only if needed
Refactor UpdateAssetsSubpathInDir so that the actual rewriting of files
happen in two different functions: one for root.html, another for
manifest.json and *.css files.
I would have wanted to simply do a
if pathToReplace == newPath { return nil }
when those two variables are defined, but the logic for root.html is not
that simple, and that may miss some edge cases, so I opted out for
simply moving the actual rewriting to individual functions, which check
for their corresponding conditions to perform the update:
1. for root.html, check that the edited file is indeed different than
the original one
2. for manifest.json and *.css files, rewrite them only if
pathToReplace != newPath, which in this case is clear that that's the
only modification we do
* Fix expected error msg in test
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* check user visibility when accepting channel invites for DMs
* stronger visibility checking for DM users
* check for correct remoteid for remote user in DM invite
* fix unit test
---------
Co-authored-by: Mattermost Build <build@mattermost.com>