* MM-26206: Add GroupMentions permissions in default channel admin
This permission was skipped from the default permissions function.
Which led to a bug where permissions reset would not bring back
this permission to the different roles.
* Added tests
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* [MM-25646] Adds the permanent delete all users endpoint to the local API
* Add a check to ensure that teams and channels are not deleted
* Fix linter
* Fix audit record name for consistency with method name
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* api4/user: add verify user by id method
* Update api4/user.go
Co-Authored-By: Miguel de la Cruz <miguel@mcrx.me>
* Update model/client4.go
Co-Authored-By: Miguel de la Cruz <miguel@mcrx.me>
* api4/user: reflect review comments
* Update api4/user_test.go
Co-authored-by: Miguel de la Cruz <miguel@mcrx.me>
Co-authored-by: Miguel de la Cruz <miguel@mcrx.me>
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
* add ServiceProviderIdentifier to config
* Update config, add unit test
* fix unit test, update i18n
* add english translation for error
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
* MM-25261: Add 'include_deleted' parameter to get all channels API request.
* MM-25261: Adds test for deleted channels.
* MM-25261: Switches to single liner.
* MM-25261: Adhere to beta config setting for viewing archived channels.
* MM-25261: Test fix.
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* new job type created that checks for expired mobile sessions and pushes notifications.
* only send session expired notifications if ExtendSessionLengthWithActivity is enabled.
* includes schema change: field added to Sessions table
* Enable gossip encryption
* Fix order
* Auto-generate key
* Update gorp fork to include BeginTx
* Add a test for InsertIfExists
And point gorp to a custom branch for now
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
* Initial request trial api creation
* Adding test license public certificate
* Adding go client method
* Applying changes to use production environment
* Removing accidentally added strings
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
* MM-25040: Only return team-associated groups if the team is group-constrained.
MM-25040: Prevents associating a group to a channel if the team doesn't have the group first.
* MM-25040: Fix lints.
* MM-25040: Still add the groupteam if the team is not group-constrained.
* MM-25040: Wraps groupteam upsert in else branch for efficiency.
* MM-25040: Removes unnecessary page iteration.
* MM-25040: Fix typo.
* MM-25040: Moves filtering to SQL.
* MM-25040: Updates tests, check pagination.
* MM-25040: Fix lint error.
* MM-25040: Adds some more group store tests.
* MM-25040: Fix for wrong test parameter.
* Fixing behavior of Replicas and SearchReplicas in canary environments
* Trying to fix tests
* Revert "Trying to fix tests"
This reverts commit 3531da9618.
* Revert "Fixing behavior of Replicas and SearchReplicas in canary environments"
This reverts commit 0c05901c84.
* Revert "Disable read/search db replicas in TE/E0 (#14400)"
This reverts commit ef5ac519d9.
* Making the store aware of the license
* Readding the unit tests
* Fixing sqlstor supplier tests
* Adding mutex to ensure license write consistency and fixing tests
* Fixing tests
* Fixing tests
* Shuting down server properly during tests
* Trying to fix tests
* Trying to fix the tests
* Skipping flaky tests
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
* make Group.Name a pointer to allow null
* fix unit tests
* fix build error
* fix unit test
* ensure Name field not nil
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
* Convert bool string comparisons to strconv.ParseBool for REST parameters
* Log failed bool conversions
* Rename errors, changed log levels
* drop strconv.ParseBool error handling
If the query string parameter is omitted, strconv.ParseBool returns an error for the empty strings, which spams the logs. Instead, just assume the default semantics of a `false` return value if an error occurs.
* allow randomized Client4 booleans
It's hard to test api4's handling of the various boolean input values
accepted. Extend Client4 with support for overriding how it builds those
strings, and pick a random value on test startup.
* gofmt -s
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
* MM-24830: Add event constants for gossip request/response
This is an accompanying PR for the shift to entirely gossip.
* Fix order
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
* [MM-20684] Initial implementation of the Command Autocomplete (#13602)
* Implement Autocomplete Data
* Change CommandName to Trigger
* Fix Autocomplete test
* Make stylistic changes
* Rename a bunch of fields and methods
* Fix variable names, safer type assertions
* [MM-20684] plugin autocomplete implementation (#14259)
* Add an endpoint for command autocomplete suggestions
* Add full Suggestion to the AutocompleteSugestion struct
* Add Dynamic Argument support
* Tidy up things
* Fix missed test case
* Add support of the named arguments
* Update autocomplete API
Fix review issues
Implement dynamic args as a local request
* Fix ineffassign
* Add support of the uppercase letters in arguments
* Add support of the optional arguments
* Remove ineffectual assignment
* Add support for icons (#14489)
* Address couple of nits
* Add comment to IconData
* Add types to all consts
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
* MM-25006: Fix occurences of unclosed http bodies
And while here, we also use ioutil.Discard to read the remaining
body instead of reading with ioutil.ReadAll which allocates a separate
byte buffer.
* Fix mistake
* Address review comments
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
* [MM-20979] Add first implementation of the Bleve search engine
* Fix i18n
* Migrate searchengine utils tests
* Fix linter
* Don't add allTermsQ if both termQueries and notTermQueries are empty
* Fix test that should work if user is system admin
* Modify naming according to review comments
* Abstract getIndexDir function
* Extracting bleve engine name as a constant
* Merge both Indexer interfaces into one
* Add worker stopped message
* Allow worker to be started/stopped with config change
* Use constants for index names
* Modify test order
* Fix linter
* Trying to unlock the CI
* [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
* [MM-24401] Base approach for Local Mode (#14333)
* 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
* 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
Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
* Fix translations order
* [MM-24832] Migrate plugin endpoints to local mode (#14543)
* [MM-24832] Migrate plugin endpoints to local mode
* Fix client reference in helper
* [MM-24776] Migrate config endpoints to local mode (#14544)
* [MM-24776] Migrate get config endpoint to local mode
* [MM-24777] Migrate update config endpoint to local mode
* Fix update config to bypass RestrictSystemAdmin flag
* Add patchConfig endpoint
* MM-24774/MM-24755: local mode for addLicense and removeLicense (#14491)
Automatic Merge
Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
Co-authored-by: Ashish Bhate <bhate.ashish@gmail.com>
* [MM-23535] Add disable database search flag and return empty posts results if set
* Add UpdateConfig function for the SearchStore and hook it into the app lifecycle
* Add the config listener in the server instance instead of using FakeApp
* Instantiate searchlayer as a pointer to avoid passing around copies of it
* add a since parameter to getGroups api
* update for lint error
* when using since, return deleted groups as well.
* update flaky test, groups have same create time
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
* add warning count as return value
* add warning count as return value
* fix file name
* update mock
* add setting warning to db
* replace wrongly removed string
* add dummy function to see if it will build
* remove dummy function
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
* add getGroupsByUserId to API layer
* update for lint errors
* add check for contextId = userId or ManageSystem Permission
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
* Disable read/search db replicas in TE/E0
* fixing tests
* Removing unnecesary text.
* Updating without-license read-replicas config before store initialization
* Reconnecting to database after remove read replicas
* MM-23935 extend session expiry on user activity
- if user types anything before a session expires the session will be extended to now + session length
- ensures new session expiries are not written to DB too frequently
- new session store func for updating session ExpiresAt
- session length defaults for mobile and web/ldap changed from 180 days to 30 days
* MM-24547: Fix writer leak when connection closes
When the connection is closed, the exit path does not
shut down the writer goroutine. In which case, it will keep spinning forever.
Since we already have the CAS mechanism now, we can move the closing
functionality into the main Close method and just call that in the defer block.
This makes closing the websocket client idempotent from both perspective -
- Explicitly closing.
- Closing due to connection tear down.
There are still 2 races left:
- Using the exported Conn to directly write messages. We cannot do anything about
that as long as clients directly using that.
- Setting the wsc.pingTimeoutTimer field in a separate goroutine when calling
.Connect(). This will need to be seen later.
* Fix ineffectual assignment
* Duplicate the closing of writer
The problem with refactoring the writer closing to a common
function was that we needed to wait for the reader to exit
before closing the EventChannel and ResponseChannel.
But then there is another problem that the API can be used in such
a way that the client is liable to call Close without even calling
Listen. In that case, we cannot wait for Listen to quit.
So from Close, we can only close the connection. And therefore
we need to duplicate the writer closing in the read loop's
defer block.
* Cleanup some comments