Commit Graph

2378 Commits

Author SHA1 Message Date
Agniva De Sarker
44eb3e3f97 MM-31326: Fix Striped LRU to have minimum of 1 bucket (#16531)
* MM-31326: Fix Striped LRU to have minimum of 1 bucket

https://mattermost.atlassian.net/browse/MM-31236

```release-note
NONE
```

* Using a maxInt function
2020-12-10 19:51:52 +05:30
Haardik Dharma
5f0f5a7a7f Update command_shortcuts.go (#16494)
Automatic Merge
2020-12-09 15:45:18 +01:00
Florent Peterschmitt
349b83f23a implement and use striped LRU cache to lower mutex contention (#15764)
* Implement Striped LRU cache

* ci

* fix

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-12-09 19:25:14 +05:30
Scott Bishel
f548ecbee1 MM-27688-OpenId Connect (#16222)
* implement openid connect

* update error strings

* handle OpenIdSetting.Secret as FAKE SETTING

* add openid to telemetry

* update config defaults, add telemetry

* fix bug with Office365

* Retrieve Office365 AuthData from IdToken

* fix linter

* add feature flag, reset defaults for config

* fix build error

* fix unit tests

* add authentication permission to Feature
Flags

* turn off feature flag

* set default button color

* set default button color only on openid

* fix for merging FeatureFlags in config

* remove feature flag

* revert config changes

* remove debug statements

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-12-08 19:58:37 -07:00
Hossein
d666bb8b3d Add Billing Permissions (#16364)
* add billing permissions

* update store.go

* Update permission.go

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-12-08 12:41:28 -05:00
Haardik Dharma
977ad99af6 Update command_shrug.go (#16481)
Automatic Merge
2020-12-08 18:15:18 +01:00
Haardik Dharma
81854aea5c Update command_mute.go (#16479)
Automatic Merge
2020-12-08 11:15:17 +01:00
Doug Lauder
46fc0c640c MM-30986 Move global logger init until after server logger fully configured (#16426)
- move the initGlobalLogger call to the end of initLogging so a copy of a fully configured logger is made for global logging.
2020-12-07 09:50:45 -05:00
Eli Yukelzon
86e228b6c6 MM-30558 - Add unreadReplies and unreadMentions to thread membership (#16304) 2020-12-06 10:02:53 +02:00
Ibrahim Serdar Acikgoz
cc5a12bad0 app/import_functions: fix a bug while improting for two teams (#16455)
Automatic Merge
2020-12-04 18:45:17 +01:00
Haardik Dharma
4e2a33386b [MM-30913]: Change receiver name for (me *CollapseProvider) in app/slashcommands/command_expand_collapse.go to be more idiomatic. (#16389)
Automatic Merge
2020-12-04 07:15:17 +01:00
Nick Misasi
fa5a033f66 [MM-30984] Missing payment email on billing day if no CC is present (#16442)
* Adding email and scaffolding for payment failure in case where customer has not added payment method

* Adding email template

* Remove unused boolean

* Fix error

* Add Email Us verbiage

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-12-03 16:02:43 -05:00
Claudio Costa
df906cad9d [MM-28422] Enable processing of import files through API (#16062)
* Implement unzip function

* Implement FileSize method

* Implement path rewriting for bulk import

* Small improvements

* Add ImportSettings to config

* Implement ListImports API endpoint

* Enable uploading import files

* Implement import process job

* Add missing license headers

* Address reviews

* Make path sanitization a bit smarter

* Clean path before calculating Dir

* [MM-30008] Add mmctl support for file imports (#16301)

* Add mmctl support for import files

* Improve test

* Remove unnecessary handlers

* Use th.TestForSystemAdminAndLocal

* Make nouser id a constant
2020-12-03 11:38:00 +01:00
Jesús Espino
a74fe05695 Removing supplier concept from the sql store (#16355)
* Removing supplier concept from the sql store

* Removing other metions to supplier

* Fixing gofmt

* Fixing gofmt

* Renaming NewSqlStore to New

* Fixing tests

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-12-02 12:06:23 +01:00
Agniva De Sarker
fc60a1e8dd MM-30988 - Fix racy test ServerSystemdNotification (#16431)
* MM-30988 - Fix racy test ServerSystemdNotification

The translateFunc is a global variable which was unguarded.
So we convert that into an atomic variable to prevent against races.

https://mattermost.atlassian.net/browse/MM-30988

```release-note
NONE
```

* fix tests

* move call upwards

* use race

* after translations init

* guard with a sync.Once

* missed import

* revert race

* update timeout
2020-12-02 14:22:41 +05:30
Haardik Dharma
e22669c403 [MM-30915]: Change receiver name for (me *JoinProvider) in app/slashcommands/command_join.go to be more idiomatic. (#16391)
Automatic Merge
2020-12-02 07:15:18 +01:00
Haardik Dharma
06543656ea [MM-30914]: Change receiver name for (me *InviteProvider) in app/slashcommands/command_invite.go to be more idiomatic. (#16390)
Automatic Merge
2020-12-02 06:15:18 +01:00
Agniva De Sarker
6ed90bf1db MM-30987- Fix race in setting clearNotify in Busy (#16430)
A time.AfterFunc runs the function in its own goroutine. So we need
to guard that with a mutex too.

https://mattermost.atlassian.net/browse/MM-30987

```release-note
NONE
```
2020-12-02 08:49:40 +05:30
John Tzikas
3fdc6cb531 Fix misspellings and enable misspell on ci (#16285)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2020-12-01 16:27:05 +01:00
Eli Yukelzon
c2036f614e MM-30970 Add Basic unreadMentions support for collapsed threads (#16407)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-12-01 17:20:23 +02:00
Haardik Dharma
64499ca767 [MM-30912]: Change receiver name for (me *RenameProvider) in app/slashcommands/command_channel_rename.go to be more idiomatic. (#16388)
Automatic Merge
2020-12-01 15:45:18 +01:00
Haardik Dharma
a01927331a [MM-30909]: Change receiver name for (me *KickProvider) and (me *RemoveProvider)in app/slashcommands/command_remove.go to be more idiomatic. (#16385)
Automatic Merge
2020-12-01 06:15:17 +01:00
Haardik Dharma
e5df69df27 [MM-30908]: Change receiver name for (me *DndProvider) in app/slashcommands/command_dnd.go to be more idiomatic. (#16384)
Automatic Merge
2020-12-01 05:45:17 +01:00
Haardik Dharma
cbc66c9a37 [MM-30916]: Change receiver name for (me *LogoutProvider) in app/slashcommands/command_logout.go to be more idiomatic. (#16392)
Automatic Merge
2020-11-30 05:15:17 +01:00
Nick Misasi
9b6ee63a1e [MM-29845] Add CWS Webhook endpoint and payment failed email (#16351)
* Add a new handler to allow authentication via CWS API Key

* Make error better

* Add tests and cases for new handler functions

* Move some code around

* Add test for GetCloudSession function

* unset the env after test completion

* Remove white space

* Add CWS Webhook endpoint and email code

* handle returned errors from email sending function

* Change FailureCode to FailureMessage

* Remove unnecessary translations

* Fix translations

* Forgot to add template

* Update api4/cloud.go

Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>

* Update api4/cloud.go

Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>

* Update api4/cloud.go

Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>

* PR changes

* Update app/email.go

Co-authored-by: Mario de Frutos Dieguez <mario@defrutos.org>

* Close body in proper spot

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>
Co-authored-by: Mario de Frutos Dieguez <mario@defrutos.org>
2020-11-25 15:45:15 -05:00
Scott Bishel
e014de0a65 MM-30802: Enable GoSAML2 library support (#16361)
* update saml to always use new library

* remove unused variable

* Update tests

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-25 08:14:56 -05:00
Eli Yukelzon
bcb861717e MM-30918 Fix product notice check when user setting is missing (#16396) 2020-11-25 09:30:44 +02:00
Haardik Dharma
5642d3106e [MM-30907]: Change receiver name for (me *AwayProvider) in app/slashcommands/command_away.go to be more idiomatic. (#16383)
Automatic Merge
2020-11-25 07:15:17 +01:00
Agniva De Sarker
64e98d535d MM-30862: Fix racy test RunComplianceReports (#16377)
We pass a copy of the compliance object to the goroutine

https://mattermost.atlassian.net/browse/MM-30862

```release-note
NONE
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-24 21:36:34 +05:30
Deep Baldha
118b3be57c MM-30821: Change to idiomatic receiver names for slashcommands.msgProvider (#16346)
Automatic Merge
2020-11-24 16:45:17 +01:00
Deep Baldha
6e450ac82d MM-30816: Change to idiomatic receiver names for slashcommands.LoadTestProvider (#16341)
Automatic Merge
2020-11-24 15:45:17 +01:00
Deep Baldha
71d975e4bd MM-30820: Change to idiomatic receiver names for slashcommands.LeaveProvider (#16345)
Automatic Merge
2020-11-24 06:15:17 +01:00
Deep Baldha
819b4b8e7b MM-30825: Change to idiomatic receiver names for app.TestHelper (#16350)
Automatic Merge
2020-11-24 05:15:18 +01:00
Nick Misasi
3099128bbd [MM-29845] Add a new handler to allow authentication via CWS API Key (#16319)
* Add a new handler to allow authentication via CWS API Key

* Make error better

* Add tests and cases for new handler functions

* Move some code around

* Add test for GetCloudSession function

* unset the env after test completion

* Remove white space

* Change Info to Warn

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-23 14:34:10 -05:00
Deep Baldha
27462bbfc9 MM-30819: Change to idiomatic receiver names for slashcommands.PurposeProvider (#16344)
Automatic Merge
2020-11-23 19:45:17 +01:00
Deep Baldha
c4891bdb51 MM-30817: Change to idiomatic receiver names for slashcommands.OfflineProvider (#16342)
Automatic Merge
2020-11-23 15:45:17 +01:00
Agniva De Sarker
d9e8402dc2 MM-30319: Fix race in ensureAsymmetricSigningKey (#16354)
A cluster changed listener always runs in a separate goroutine.
This causes a race condition when a new member gets added in the cluster.

We fix it by accessing the value atomically.

I tried to write a test for this, but it wasn't triggering at all.
The best way is to just start the server with cluster enabled in race mode,
and verify that the race doesn't happen.

https://mattermost.atlassian.net/browse/MM-30319

```release-notes
NONE
```
2020-11-23 19:18:24 +05:30
OgmaJ
d28e7ec870 [MM-30136] Issuing /dnd consecutively should not toggle the user status between dnd and online (#16258)
Summary
/dnd will only do a do not disturb

Ticket Link
Fixes #16253
JIRA https://mattermost.atlassian.net/browse/MM-30136

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-23 15:06:43 +05:30
Jesús Espino
9ec09c2bcd Remove unneeded Err field in the store result struct (#16322)
* Remove unneeded Err field in the store result struct

* Fixing references to old errors in the tests
2020-11-23 09:26:01 +01:00
Harrison Healey
c54ab6da21 Revert "[MM-29224] Fix bug where markdown image link doesn't show preview (#15862)" (#16326)
This reverts commit 07948ae7bc.
2020-11-20 11:23:21 -05:00
Agniva De Sarker
4cdf239139 MM-29107: Fix race in LDAP login (#16239)
* MM-29107: Fix race in LDAP login

We remove the goroutine to make things synchronous.

This removes the race and makes things more reliable.
It is already tested by TestLogin in ldap_test.go in -race mode.

https://mattermost.atlassian.net/browse/MM-29107

```release-note
NONE
```

* Address review comments

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-20 18:07:31 +05:30
Eli Yukelzon
cf4df5fcd2 MM-30048 added thread related socket messages (#16234)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-20 11:00:52 +02:00
Deep Baldha
7b515d27f2 MM-30705: remove receiver names for empty struct- InvitePeopleProvider (#16300)
Automatic Merge
2020-11-20 00:15:17 -05:00
Ibrahim Serdar Acikgoz
213345fa2c add manage_remote_clusters permission (#16252) 2020-11-18 18:40:12 +03:00
Ibrahim Serdar Acikgoz
50e29cb47a app/user: fix update user error when an e-mail address already in use (#16269)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-18 12:31:57 +03:00
Agniva De Sarker
221f70a6cb MM-29487: Fix racy TestMuteCommandSpecificChannel (#16290)
The code was doing `go fakeApp.UpdateProductNotices()`
due to which the Store object was accessed in a racy manner
when it was reset if the localcachelayer flag was set.

We fix this by using the StoreOverride functionality
to pre-define what store to use while initializing the server
itself so that there isn't a need to reset the store _after_
the server is set.

We also apply the same fix in the app and api4 layers too
to prevent similar things from happening there.

https://mattermost.atlassian.net/browse/MM-29487

```release-note
NONE
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-17 21:13:35 +05:30
Ben Schumacher
4063f407a1 Use different user-agent for twitter links (#16210) 2020-11-17 14:48:51 +01:00
Rodrigo Villablanca
95221d9ace GroupStore migration (#15795)
* Migration completed

* Fix tests

* Fix tests

* Fix tests

* Suggestions

* Trigger CI

* Suggestions

* Merge with master

* Migration completed

* Fix typo

* fix err check

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in>
2020-11-17 09:02:36 +05:30
Harrison Healey
2ebc8ec90f MM-20897 Add category muting (#16225)
* Make UpdateSidebarCategories return the original categories

* MM-20897 Add category muting

* Prevent muting the DMs category

* Fix muted state not being stored in the database

* Address feedback

* Address some feedback

* Fix unit tests

* MM-20897 Mute/unmute channels in the database in bulk

* Satisfy golangci-lint
2020-11-16 15:19:01 -05:00
Miguel de la Cruz
6c857a4525 [MM-30436] Add support for configuration custom defaults (#16265)
* [MM-30436] Add support for configuration custom defaults

* Addressing review comments

* Addressing PR comments

* Soft fail if the configuration defaults cannot be read

* Directly print error in log message

* Fix linter

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-16 15:25:48 +01:00