* Change link to redirect email notifications to landing page
* Fix to undefined variable
* Change `vault` to `landing`
* Added a couple tests
Co-authored-by: David Meza <dmeza@users.noreply.github.com>
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
* promote user to admin upon login
* Add SAML support for admin accounts
* update en.json
* update i18n
* Add tests as per comments
* change function name
* fix config.go
* invalidate cache so its not checking for cache when roles change
* add enable attribute and filter
* MM-20644: Add users to teams as a SchemeAdmin based on a new configuration field on GroupTeams and GroupChannels records.
* MM-20644: Adds SchemeAdmin to mapping of the GroupSyncable struct fields.
* MM-2064: Adds test to ensure SchemeAdmin field value is mapped.
* MM-20644: Adds missing index creation for fresh DBs.
* MM-20644: Duplicates UpdateMembersRole across Team and Channel stores. Adds tests.
* MM-20644: Fixes some old method name references.
* MM-20644: Moves variable declaration; removes Println statement.
* MM-20644: Use a SQL query instead of two to update Team and Channel members.
* MM-20644: Fixes tests; updates query.
* MM-20644: Fix permission check for patching a group syncable.
* MM-20644: Fixes test for change of permissions verification in group patch API request.
* MM-20644: Fix for ORM select vs insert.
* MM-20644: Linting fixes.
* MM-20644: Fixes some tests.
* MM-20644: Skips changing the role of guests.
* MM-20644: Added syncableID filtering
* Refactor to use structured logging
* Properly formatted with gofmt
* created interface Cache, but construction of cache is still coupled.
* Implementing cache factories to build caches
* Simple redis implementation without error handling. Keys and values by default are string
* refactor NewLocalCacheLayer to inject cache factory
* Removed redis impl to focus on cache abstraction
* CacheFactory injected on sqlsupplier and saved in Store struct
* remove useless private method
* replace concrete declaration of lru cache to cache abstraction
* discard spaces
* Renamed factory to provider because concrete implementations of factories may hold an state (such as a redis client for example)
* refactor to include all caches in the same package cache and subpackages
* method close cache. This method will be used for concrete implementations that need to release resources (close a connection, etc)
* closing cacheprovider and releasing resources while closing sql store
* fixed merge conflict fail
* gofmt files
* remove unused property from post_store
* naming refactor to avoid stutter. Added godocs on interface
* Store doesnt know anything about the cache and provider. Cache provider will be built after loading config and injected in localCacheLayer
* fixed broken test
* cache provider initialized before RunOldAppInitialization which initializes the localcachelayer
* move statusCache to server to initialize it with the new cache provider
* update terms_service and channel_layer to have new cacheProvider
* gofmt
* Add Connect method to the cache provider
* mock cacheprovider in user_layer_test
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
While sending the config broadcast message across a cluster, we would
include the environment overrides in the config.
We fix this by exposing a config config store method to remove the overrides,
and then calling that before saving the config across the cluster.
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
While invalidating a channel, we send out a cluster message
from the app layer as well as from the localcachelayer.
This causes multiple redundant messages to be sent out.
And additionally multiple cluster handlers were being registered
from the app layer as well as the localcachelayer.
We fix this by removing the cluster broadcast from the app layer
and directly calling the store method. We also remove
the duplicate event handler registration.
* MM-21336: Improve channel rename restrictions
Non-direct channels should not have __ in them.
* Fix order of i18n extraction
* Incorporate review comments
Use a more relaxed check by actually checking for valid userIds.
* Improve error message
When push notification setting was selected to "All Activity", we were
just sending the unread count for the channel from where the message was sent
and not for all channels.
After discussion with @enahum and @migbot, we decided to keep the badge count
to only refer to mentions and not unread posts.
Therefore, we only take the unread count for the user irrespective of the
notify_props settings.
Updated the tests to reflect that.
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
* MM-21209: Use the LRU cache for UserStore.Get call too
We already have userProfileByIdsCache to store the user profiles by Id.
It just wasn't being used for the (*UserStore).Get method. We add a wrapper
method in LocalCacheUserStore to intercept that call and check for the
presence of the user Id in the cache.
There is no need to add any code for invalidation as all of that is already
present.
* Fix nil check for rootstore
* Fix TestUserStore test
Added an invalidate call. The invalidation was being done
from the app level. Hence we have to do it manually here for the test.
Display LHS bot Icon in web app. As part of mentioned task, Added LastIconUpdate variable in model.bot to store last update time of icon. Also added code to update/delete value of the mentioned variable when setting/deleting bot icon.
* Make WebSocketEvent type immutable
* Update code to use updated immutable WebSocketEvent type
* Export WebSocketEvent fields and mark them as deprecated
* Channel Member update event
* Address PR comments and extend tests
* golang ci addressed
* Update api4/channel_test.go
Co-Authored-By: Ben Schumacher <ben.schumacher@mattermost.com>
* Implement allowing multiple SAML Libraries
* fix unit tests
* updates based on review feedback
* Only set on startup, not config changes
* update unit tests, reload enterprise
* need to reset for previous tests
* update license statement
* fix licensing line
* MM-14675: Upserts GroupTeam when GroupChannel is linked.
MM-14675: Delete all associated GroupChannels when deleting a GroupTeam.
MM-14675: Using replica DB where possible.
MM-14675: Updates create method used in tests.
* MM-14675: Removes unnecessary DB retrieval of GroupSyncable record.
* MM-21103: change plugin signature path
Save as `<plugin_id>.tar.gz.sig` instead of `<plugin_id>.sig`. The latter was a relic of the previous design to support multiple plugin signatures, but now creates an inconsistency with how the original source files were supplied as `<some_name>.tar.gz` and `<some_name>.tar.gz.sig`.
Fixes: https://mattermost.atlassian.net/browse/MM-21103
* relax signature matches to avoid assuming signatures always exist
* Add notification, to sysadmins, when a user is disabled and the user
owns bots.
* If the user doesn't have any bots, there is no need to send a
notifcation to sysadmins
* Remove comment
* Update documention link
* Send as System
* Query teams for each sysadmin and add first response to hardcoded link.
* Remove fmt.print debug statements
* remove link with hard-coded team. Will add this as future enhancement
Expose GetDisableBotSysadminMessage function so it can be tested
Add test new function for testing new notification feature
* Fix shadow error
* Swap sentences in the message when System Console > Bot Accounts > Disable bot accounts when owner is deactivated: is set to false
* Another message correction
* Rename Custom Integrations to Integrations
* rename botsDisabled variable to disableBotsSetting
* - increase the number of bots and sysadmins queried to 1000.
- limit the number of bots printed in the post to 10, but mention the
total bots owned by the user
* Enable translations for sysadmin messages
* - Rename function. The actual purpose for the function is to notify
sysadmins that a user, that owned bots, was disabled.
- convert GetDisableBotSysadminMessage from a function to a method.
This allows getting *a.Config().ServiceSettings.DisableBotsWhenOwnerIsDeactivated
in the method and avoids having to pass the value as an input to a
function
* fix "make i18n-extract" error. Reorganize .json file
* Correct the upper range value to be the minimum of number of elements in the
userBots array, or the upper limit (10)
* replace t.fatal with require statements
fix golangci-lint errors
* Create separate message when user managed less than or fewer than 10 bots
Test cases for both message types
* fix i18n sorting
* Using pagination to get the bots and sysadmins instead of setting
arbitrary value for PerPage and only retrieving first page
* only use one translation ID for the message.
push all logic into the template so translators can view the logic
add disableBotsSetting and printAllBots variables to the translation
map
* Break the for loop once len(bots) < perPage value, instead of
breaking once there are no bots. This saves one additional call
* Test added to check support for import of messages sent to your own DM
channel
* Support for single member direct channel messages and posts
Now bulk import is able to export/import the self direct channel and
the posts inside
* Improve how the copy of channel members for DM and DM posts
* Improved the tests for the export self-channels
* MM-8607: Add cluster support for server busy status
MM-8607: Busy.Cluster should be non-exported
MM-8607: rename logging field seconds -> expires_sec
MM-8607: each node clears its own busy flag
MM-8607: ensure unit tests are not sensitive to test machine speed
* MM-8607: chg comment to force CI rebuild
* Limit size of files inside Zip archive before JSON parsing for Slack import
* Use specific log message when skipping file in Slack import zip due to size
* Updated max size for slack import
* Consistent license message for all the go files
* Fixing the last set of unconsistencies with the license headers
* Addressing PR review comments
* Fixing busy.go and busy_test.go license header
Flugin: fix InstallPlugin() API by manually creating RPC code
previous implementation of InstallPlugin()-#12232 's RPC funcs wasn't working because `io.Reader` isn't supported by the RPC code generation tool.
RPC does not support streaming data and RPC code generation tool does not handle this exception.
thus, RPC funcs are now implemented manually to stream `io.Reader` through a separate multiplexed connection.