Граф коммитов

1756 Коммитов

Автор SHA1 Сообщение Дата
Jesse Hallam
4f7bd2200d MM-18651: no spurious mentions on leaving channels (#12527)
Today, the server emits a system message containing one of `<username> left the channel.` or `<username> removed from the channel.` when such an event occurs.

While the client interprets this special kind of message to take into account the enduser's username display settings (e.g. to render `First Last left the channel.`), the server also processes this "message" to look for mentions.

With the user in question no longer in the channel, it incorrectly splits usernames containing a period into two tokens and tries to mentions users accordingly. So `christopher.poile` ends up trying to mention `christopher` and `poile`. If such a user exists, they receive a spurious mention for this event.

Change the message rendered by the server to explicitly prepend an `@`, which in turn is detected by the mention logic to avoid splitting. As above, this has no effect on the client-side rendered message.
2019-10-21 14:56:08 -03:00
Carlos Tadeu Panato Junior
709f407d33 update build image to go 1.13 (#12833)
* update build image to go 1.13

* Define TLS Max Version for Clients since TLS1.3 does not allow cipher suites to be configured
2019-10-21 15:31:29 +02:00
Claudio Costa
3c06fc28ad Add parsing and validation for old filenames migration (#12827) 2019-10-18 17:21:23 +02:00
Christopher Speller
e62471dff6 MM-18816 Adding ability to add users as another user to the plugin API. (#12562)
* Adding ability to add users as anouther user to the plugin API.

* Documentation feedback.
2019-10-17 16:11:26 -07:00
Nikhil Ranjan
d7ee3553fa Plugin framework: add ability to install other plugins to the… (#12232)
* add ability to upload other plugins to the plugin API

* generated client rpc glue code

* fix UploadPlugin API signature

* generated plugin mocks

* added upload plugin test

* removed unused comment

* using single line to call InstallPlugin with file Reader

* fix minimum server version

* added successful plugin upload test

* renamed UploadPlugin to InstallPlugin
2019-10-17 14:57:55 -04:00
Michael Kochell
8c94f48991 [MM-18831] Trim whitespace of Display Name when channel is cre… (#12380) 2019-10-17 10:39:27 -06:00
Ogundele Olumide
47e3685419 MM-18270 Refactor "app/server.go" to use structured logging (#12505) 2019-10-17 17:04:57 +02:00
Ben Sooraj
c7e2689926 mlog standardisation for app/import.go (#12741)
* mlog standardisation for app/import.go

* using the corrent mlog.Field type for the error
2019-10-17 11:18:08 +01:00
Eli Yukelzon
66c66eef0d MM-19371 - Reply count disappears from pinned and flagged conv… (#12753) 2019-10-17 11:10:49 +03:00
Arjit Chaudhary
1a2197ec8e Refactor "app/export.go" to use structured logging #12727 (#12729)
* Refactor "app/export.go" to use structured logging #12727

* use mlog.String

* use mlog.Bool, mlog.string needs 2 values?

* Update export.go

* s/reaction_UserId/user_id
2019-10-15 17:31:46 -04:00
Ben Sooraj
710c732349 mlog standardisation for app/channel.go (#12738) 2019-10-15 15:25:12 +02:00
Ogundele Olumide
6b901773e6 MM-18274 Refactor "app/email.go" to use structured logging (#12504)
* chore: refactor to use structured logging

 - change fmt.sprintf method used in the logger to appropriate mlog
   method

* implement suggested changes by removing added line during merge conflict
2019-10-15 12:27:09 +02:00
Jesús Espino
441777a4e7 Only include the avatar attachment if is going to show a message in the invitation (#12747) 2019-10-15 11:16:31 +02:00
Scott Bishel
06866952b6 MM-16861: Support Guest Authentication via AD/LDAP (#12690)
* Add config settings for LDAPSettings GuestFilter

* make error unique

* Update model/config.go

Co-Authored-By: Martin Kraft <martin@upspin.org>

* add LdapSetting isempty_guest_attribute to diagnostics.go
2019-10-14 11:38:17 -06:00
Jairo Junior
babbe087ff Convert app/import_test.go t.Fatal calls into assert/require calls (#12228) 2019-10-13 21:38:28 +02:00
Ogundele Olumide
867027117e MM-18281 Refactor "app/server_app_adapters.go" to use structured logging (#12503)
* chore: refactor to use structured logging

 - remove the unsed fmt package
 - convert the fmt.sprintt to the structured logging

* implement requested changes from iomodo

* implement feedback from willfrog
2019-10-11 16:24:54 +02:00
Clément Collin
7f8a894592 [MM-19007] Migrate tests from "app/job_test.go" to use testify (#12433)
* [MM-19007] Migrate tests from "app/job_test.go" to use testify

- Use 'require' and 'assert' methods instead of 't.Fatal'

* [MM-19007] Change 'assert' to 'require' to keep 't.Fatal' behavior
2019-10-11 14:08:07 +02:00
Jason Blais
52c4b8f9c9 Add missing guest account config setting diagnostics (#12692) 2019-10-11 13:27:55 +02:00
Jesse Hallam
25b340ecb7 Revert "Do not count deleted channels when checking max channel limit (#12021)" (#12730)
This reverts commit d6700e3b40.
2019-10-10 16:16:25 -03:00
Ali Farooq
72965d864a MM-18881 - Attempting to configure uninstalled plugins gets st… (#12687)
* MM-18881 - Attempting to configure uninstalled plugins gets stuck at Loading... without timeout.

* Added a test

* Closing websocketclient
2019-10-10 15:01:39 -04:00
Scott Bishel
3f6f44f34c MM-16860 Support Guest Authentication via SAML (#12622)
* add GuestAttribute setting

* Add Constant

* add isdefault_guest_attribute to diagnostics.go

* revert changes to go.mod

* revert changes to LdapInterface.go

* revert changes to LdapInterface.go

* revert changes to LdapInterface.go
2019-10-10 11:37:57 -06:00
Eli Yukelzon
34b4bbcb46 MM-18623 - invalid reply-count displayed (#12364)
* fixed thread creator, fixed default behaviour of fetching posts
* handle reply-count in getPostThread code path
2019-10-10 17:14:44 +03:00
Abado Jack Mtulla
7a0d9149eb Migrate app/import_functions_test.go to testify (#12495)
- Use 'require' and 'assert' methods instead of 't.Fatal'
2019-10-10 14:54:40 +03:00
Ali Farooq
7b6b54c341 MM-18540 - Demo plugin crashes on server shutdown (#12371)
* MM-18540 - Demo plugin crashes on server shutdown

* MM-18540 - Removed unncessary lock statements

* Added comments, logging a warning if PluginsEnv is updated while shutting down plugins

* Don't clean up PluginsEnv if another Env is detected

* Changing warn to debug

* Revert "Changing warn to debug"

This reverts commit 46f20ab21eeabb01d07f53e02d850cd6d9b2b837.
2019-10-09 17:19:01 -04:00
Hector
c02b489302 Mm 19006 (#12616)
* Refactor to use structured logging

* Properly formatted with gofmt

* migrate tests to use testify

* fix: swap expected and actual
2019-10-09 15:43:13 -04:00
Martin Kraft
598f7c7255 MM-17767: Remove ExperimentalLdapGroupSync config. (#12388) 2019-10-08 08:03:39 -04:00
Pradeep Murugesan
488ae1abad turned off email notification for the status DND (#12502)
* turned off email notification for the status DND

* extracted the userAllows email logic as a separate function

* removed the unused function
2019-10-08 09:57:20 +02:00
Marc Argent
1a126b5133 GH-12335 Refactor app/session.go to use structured logging (#12529)
* GH-12335 Refactor app/session.go to use structured logging

* Remove placeholders
2019-10-06 16:01:42 +03:00
Agniva De Sarker
20ff7032a6 Fixed some ineffective assignments (#12543) 2019-10-03 15:45:27 +03:00
Nikhil Ranjan
3e0da03310 Convert app/user_test.go t.Fatal calls into assert/require calls (#12219)
* Convert app/user_test.go t.Fatal calls into assert/require calls

* arrange expected and actual arguments as per semantics

* arrange expected and actual arguments as per go semantics

* fix for notEqual
2019-10-02 10:00:42 -07:00
Jesús Espino
6ba961a480 Embedding avatar in guest invite emails (#12328)
* Embedding avatar in guest invite emails

* Fixing tests

* Improving mailservice tests

* Fixing shadow variables

* Fixing styles for gmail

* Keep spacing on invite messages

* Fixing spacing
2019-09-30 23:27:07 +02:00
Jesús Espino
8cea561ba6 More robust team exists api endpoint (#12130)
* More robust team exists api endpoint

* Making the code more concise

* Better handling of errors on GetTeamByName
2019-09-30 21:39:21 +02:00
Nikhil Ranjan
e5ba0a0a18 Converting to structured logging the file app/oauth.go (#12135) 2019-09-29 12:42:53 +02:00
Jesse Hallam
74533371b2 MM-18115: fix segment v3 usage (#12317)
* diagnostics_test.go: fix spacing

* diagnostics_test.go: explicitly assert payload

This fails, since the package is currently receiving struct pointers and won't set the MessageId or Timestamp on the corresponding Message.

* MM-18115: fix segment v3 usage

In v5.14, we updated [github.com/segmentio/analytics-go](https://github.com/segmentio/analytics-go) to v3 as part of https://mattermost.atlassian.net/browse/MM-12389. As noted in the [migration guide](https://segment.com/docs/sources/server/go/#migrating-from-v2), the API subtly changed to expect a struct value and not a struct pointer:

```go
// in v2, you would call the `Track` method with a `Track` struct.
client.Track(&track)

// in v3, you would call the `Enqueue` method with a `Track` struct.
// Note that a pointer is not used here.
client.Enqueue(track)
```

Unfortunately, we kept passing a pointer, and the package didn't complain since it only required an interface -- which the pointer to these structs still implemented. Internally, it only checked for the value types, and failed to annotate our payloads with the requisite metadata. Upstream, segment.io accepted the payload, but then discarded it silently.

This has since been reported and fixed in https://github.com/segmentio/analytics-go/pull/146, but isn't yet part of a tagged release of the package.

Fix our code to pass struct values instead.

Fixes: MM-18115
2019-09-26 23:49:43 -03:00
Michael Kochell
1a4d7869cb [MM-18628] Fix flaky OpenGraph test (#12365)
* use local httptest server instead of github.com

* use switch statements
2019-09-26 13:54:51 -04:00
Ogundele Olumide
1f9d14e24c chore: refactor to use structured logging (#12256) 2019-09-24 18:30:23 +02:00
Nikhil Ranjan
7ba491ac2d Converting to structured logging the file app/notification_pus… (#12126) 2019-09-24 17:10:47 +02:00
Nikhil Ranjan
7464449478 Convert app/config_test.go t.Fatal calls into assert/require c… (#12220) 2019-09-24 16:49:23 +02:00
Nikhil Ranjan
d130131a88 Convert app/web_hub_test.go t.Fatal calls into assert/require… (#12222) 2019-09-24 16:44:01 +02:00
Ogundele Olumide
be340bb7c7 MM-18317 Migrate tests from import_validators_test.go to use t… (#12129) 2019-09-24 15:37:47 +02:00
Nikhil Ranjan
230a518059 MM-18288 Converting to structured logging the file app/web_hub… (#12133) 2019-09-24 15:35:20 +02:00
Phillip Ahereza
14bf82ad03 [MM-18320] Migrate tests from "app/email_batching_test.go" to… (#12079) 2019-09-24 15:33:58 +02:00
Micah Thompson
fa6b98df3c Migrate tests from 'app/oauth_test.go' to use testify (#12155) 2019-09-24 15:32:13 +02:00
Nikhil Ranjan
69eb2faf3d Convert app/login_test.go t.Fatal calls into assert/require ca… (#12221) 2019-09-24 15:25:24 +02:00
sowmiyamuthuraman
3802c1e4d3 Replace t.fatal() to testify require/assert calls (#12174) 2019-09-24 15:23:30 +02:00
Darrell Richards
a3c5cd5760 GH-12100 Mirgrated tests in app/channel_test.go (#12217) 2019-09-24 15:22:09 +02:00
Renil Joseph
945a099c06 MM-18383: updated tests using fatal to use assert (#12175) 2019-09-24 15:10:58 +02:00
Darrell Richards
417dd7997a GH-12196 Converting to structured logging in app/import_functions.go (#12205)
* Updated Logging for mlog and removed fmt

* Changed up wording from last PR.
2019-09-20 12:45:28 -06:00
Nikhil Ranjan
c4d6b0213e Convert app/notification_email_test.go t.Fatal calls into asse… (#12227)
* Convert app/notification_email_test.go t.Fatal calls into assert/require calls

* changes as per review

* using require.Regexp instead of require.True
2019-09-20 09:04:10 -06:00
Nikhil Ranjan
8cd9dac632 Convert app/user_agent_test.go t.Fatal calls into assert/requi… (#12224) 2019-09-20 16:53:48 +02:00