Commit Graph

10166 Commits

Author SHA1 Message Date
Christopher Speller
de1ce2373d Fix build. (#9188) 2018-07-30 13:15:24 -07:00
Martin Kraft
5872bf9c2f Pr 9039 (#9187)
* MM-11065: Allow to search and get archived channels from the API

* Fixing more tests

* Add some unit tests

* Add includeDeleted parameter to session permissions check function

* More test fixing

* Adding archive channels list in channels search

* Add restriction for archived channel edition

* Reverting permissions checks modification

* Changed the query parameter to include_deleted

* Enable search archive channels as true by default

* Adding tests for verify search on deleted channels

* Allowing to override archive channels during the imports

* Fixed test

* Search in archive channels from the API must be explicitly requested

* Removing includeDeleted parameter from GetChannelByName and GetChannelByNameForTeam

* Back to ViewArchivedChannels config

* Fixing tests

* Reverting GetChannelByName parameter

* Add include deleted parameter on GetChannel functions in plugins api

* Fixing tests
2018-07-30 15:06:08 -04:00
Martin Kraft
65cd447a61 MM-11301: Validates listen address config value. (#9138)
* MM-11301: Validates listen address config value.

* MM-11301: Adds some invalid port test cases.

* MM-11301: Accept domain names.

* MM-11301: Fix for max port.
2018-07-30 14:59:08 -04:00
Daniel Schalla
d23ca07133 Login Hooks (#9177)
Tests; gofmt
2018-07-30 11:55:38 -07:00
Jesús Espino
08e54ed824 Split notifications file into different files (#9164) 2018-07-28 19:20:44 +02:00
Saturnino Abril
51dc5fa36e [MM-10621] Set createAt timestamp on file upload api call to secure upload order of files (#9170)
* set createAt timestamp on file upload api call to secure upload order of files

* fix test on plugin hooks
2018-07-28 14:27:55 +08:00
Joram Wilander
6ac82d5171 Implement OAuth2 implicit grant flow (#9178) 2018-07-27 17:35:43 -04:00
Joram Wilander
441c8741c1 Fix compile error caused by bad merge (#9176)
* Fix compile error caused by bad merge

* Fix

* Fix
2018-07-27 12:57:17 -04:00
Jesse Hallam
835c0871a0 MM-11431: handle plugin deadlocks (#9167)
* ensure plugin is always shutdown

Once we call `.client.Client()` the plugin has started, and must be shut
down. `newSupervisor` sometimes returned with an error (and without a
reference to the supervisor), leaving the client running indefinitely.

* Clarify the documentation to explain that plugin hooks will not trigger until `OnActivate` returns successfully, and will stop triggering just before `OnDeactivate` is called.

* test for plugin deadlock

* plugin/environment.go: switch to sync.Map

From: https://golang.org/pkg/sync/#Map

> If a goroutine holds a RWMutex for reading and another goroutine might call Lock, no goroutine should expect to be able to acquire a read lock until the initial read lock is released. In particular, this prohibits recursive read locking. This is to ensure that the lock eventually becomes available; a blocked Lock call excludes new readers from acquiring the lock.

The previous `RWMutex` was not safe given that we effectively acquired read locks recursively (hook -> api -> hook). This worked up until we activated or deactivated plugins, tried to acquire a write lock, and the plugin used the API to effectively trigger another hook.

Switching to sync.Map avoids this by divesting the need to lock at all, avoiding the potential for a recursive lock in the first place.
2018-07-27 11:37:17 -04:00
Jesse Hallam
1d9c144854 s/mlog/log/ in apiRPCClient (#9171)
We never actually initialized `log` on apiRPCClient, and it can't log
without making an RPC call anyway, so just switch to logging errors from
the plugin to STDERR instead.
2018-07-27 08:17:29 -07:00
Christopher Speller
026f0152a8 Adding FileWillBeUploaded plugin hook (#9169)
* Adding file upload hook.

* Adding hook test for FileWillBeUploaded

* Some debugging fixes.

* Fix typo.

* Fixing double close

* Fix capitalization on docs.
2018-07-27 08:25:53 -04:00
Christopher Speller
90e5e279c1 Fix file streaming to close files. (#9168) 2018-07-26 10:52:24 -07:00
Christopher Speller
bae26ec268 MM-11160 Adding proper CORS support. (#9152)
* Adding proper CORS support.

* Better CORS tests.
2018-07-26 08:31:22 -07:00
George Goldberg
185ed89978 MM-11243: Make Elasticsearch work after enabling without restart. (#9146)
* MM-11243: Make Elasticsearch work after enabling without restart.

* Also cope with config vars changing whilst enabled.
2018-07-26 15:50:38 +01:00
Jesse Hallam
8948b91d7a unpack prepacked plugins on plugins initialization (#9149)
* unpack prepackaged plugins on plugins initialization

* leverage utils.FindDir
2018-07-26 08:45:26 -04:00
Jesse Hallam
f8f80d80df Fix plugin.ServeHTTP subpath (#9161)
* test ServicePluginRequest with subpath

* handle subpath when routing to plugin.ServeHTTP
2018-07-26 08:33:56 -04:00
Pradeep Murugesan
b3c2ecd9b9 added the custom icon and username for the outgoing webhook and its response (#9141)
* 8272 added the username and icon as part of the model and persisted the same

* 8272 added the custome icon and name when set to the web hook response

* 8272 changed the infinte loop to timeout after 5 seconds

* 8272  fixed review comments
2018-07-25 08:31:41 -04:00
Jesse Hallam
b89ccca929 fix plugin example docs (#9148) 2018-07-25 08:01:13 -04:00
Hyeseong Kim
8387d92ea2 MM-10381: Change the file downloading API to stream file (#9144)
* Change the file downloading to stream file

* Change file downloading to chunk only for preview

* Remove unnecessary else case
2018-07-24 11:23:54 -07:00
Harrison Healey
c8d3e42139 MM-11451 Added autolinking to Markdown parser (#9151)
* MM-11451 Added autolinking to Markdown parser

* Added missing headers

* Added mailto and tel links
2018-07-24 07:40:01 -07:00
Jesús Espino
bfb2640451 Add idiomatic error handling in mattermost commands (#9147) 2018-07-24 10:11:47 -04:00
Chris Duarte
da124f018d Add ExperimentalSidebarPreference in the config (#9013)
* Add ExperimentalSidebarPreference in the config

* Override Sidebar preference based on GroupUnread settings

* Rename to ExperimentalChannelOrganization

* Add Sidebar config in diagnostics

* Fix diagnostics for experimental_channel_organization
2018-07-23 11:18:24 -04:00
Jesús Espino
e475cecf00 Remove unnecesary elses after return error (#9137) 2018-07-23 11:55:42 +05:30
Christopher Speller
bac3376278 Updating dependencies (#9139) 2018-07-22 20:14:05 -07:00
Daniel Schalla
3539a9a60b Default Channel Functionality + Test Suite (#9068)
gofmt

Make skipping for non public channels default

Deduplication of Default Channels; Only post join to townsquare

Post join channel message for all custom default channels
2018-07-20 17:00:58 -04:00
Yusuke Nemoto
6104c37761 Break HTML blocks to individual strings (#8903)
* Modifying message and templates about mfa_change

* Modifying message and templates about password_change

* Modify message and template about password_reset

* Modify message and template about singin_change

* Modify message and template about email_info

* Modify message and template about change_username

* Modify message about change_email

* Add missing props

* Add argument

* Modify message and template about token_added

* Modify messages and template about notification_email

* Modify message and template about deactivate_email

* Fix style

* Remove unused message

* Remove br tags

* Modify message and code about invite_mail

* Add missing message
2018-07-20 12:52:20 -04:00
Jesse Hallam
908a682fcf make GetChannelByName take teamId first (#9134)
* make GetChannelByName take teamId first

I think it is more natural to accept `teamId`, then `channelName`,
given the pattern followed by other Plugin API methods and even the SQL
Store itself. The App layer seems unusual in accepting `channelName`
first.

This also re-generates the mocks fixing the parameter order for the
recently added `UserStatus` APIs.

* add GetChannelByNameForTeamName
2018-07-20 09:03:08 -07:00
Jesús Espino
610ac5a53c MM-11003: Global Relay Export Refactor (#9136) 2018-07-20 17:13:35 +02:00
Jesús Espino
e97104a3c4 Using idiomatic error handling in channel store (#9130) 2018-07-20 12:39:48 +02:00
Jesús Espino
edb4443dfb Renamed translation in actiance export (#9132) 2018-07-20 12:25:24 +02:00
Pradeep Murugesan
ee1d037ca6 Support attachments in post and replies - Bulk import (#9124)
* 9006 - process the attachments of the post

* 9006 enabling the import of attachments in the reply post

* 9006 assert if the post and files are linked

* 9006 fixed the typo
2018-07-20 16:49:49 +08:00
Jesús Espino
17c0817361 Add missed plugin error translation (#9131) 2018-07-19 10:46:53 -07:00
Joram Wilander
9aab19d462 Temporarily comment out until MM-11108 to fix builds (#9133) 2018-07-19 09:58:58 -04:00
Harrison Healey
768f2b85bc MM-11389 Added diagnostics for FileSettings.Directory (#9125) 2018-07-19 11:01:39 +02:00
Adrian
a575411f15 Fix invalid markdown text ranges (#9126)
second Range value is the end pos, not the length... 🙈
2018-07-18 19:55:50 -07:00
Christopher Speller
5a2d46c6cb MM-11028 Adding some plugin tests. (#9103)
* Rearranging plugin mocks and moving some common test code out.

* Adding tests.

* Fixing tests after GoDoc cleanup changes.
2018-07-18 16:35:12 -07:00
Jesse Hallam
309a3dda60 Support server, deprecate backend in plugin manifest (#9127)
* Support `server`, deprecate `backend` in plugin manifest

This lets us converge on the use of the term `server` everywhere instead
of sometimes `backend` and sometimes `server`. We're still using
`webapp` and will eventually support `mobile` as well.

The plan is actually to rip out these deprecations as part of releasing
5.2, but I want to coordinate the extra additional breakage at the same
time, so for now this is a backwards compatible change.

* fix failing tests
2018-07-18 15:32:33 -07:00
Joram Wilander
cbd3fa4b3b Lock go-hclog and go-plugin dependencies to a revision (#9128) 2018-07-18 15:31:35 -07:00
Chris Duarte
3fcecd521a Support for Embeded chat (#9129)
* Add ucLive support

crazy testing

lovely logs

more cookie work arounds

Added Access-Control-Expose-Headers to user login

Add complete_saml_body template and revert loginWithSaml endpoint

Set Access-Control-Allow-Credentials to true in user login

Login via email instead of username

Clean up code

Add comment to give some context

Move faml logic into saml function

Communicate via chrome sendMessage api

Remove unused code

Add config to support multiple extensions

Clean up embedded complete_saml template

Fix indentation for templates

Added license header to extension.go

Add EnableExperimentalExtensions flag

Extension validated for email auth

Clean up api auth code

Remove complete_saml_body.html

* Add extension support in saml

* Clean up code

* Clean up extension validation
2018-07-18 14:56:38 -07:00
Elias Nahum
6b27b74f0c translations PR 20180718 (#9123) 2018-07-18 11:30:48 -04:00
Jason Blais
715de382d2 Update en.json (#9096) 2018-07-18 17:24:43 +02:00
Druhin Bala
301e7eb1c4 MM-10699 Add channel renaming to CLI (#9094) 2018-07-18 11:49:48 +01:00
Jesús Espino
b367b1ff40 Do not close the connection abruptly on too big file uploads (#9083) 2018-07-18 10:07:00 +02:00
Jesse Hallam
e718d2544f MM-11366: support a plugin bundle with multiple executables (#9121)
This avoids the need to distribute multiple plugins per architecture.
2018-07-17 15:47:05 -07:00
Joram Wilander
f2c1803905 Make plugin IDs case insensitive (#9117) 2018-07-16 16:56:55 -04:00
Joram Wilander
275731578e MM-10254 Add plugin APIs for getting/updating user statuses (#9101)
* Add plugin APIs for getting/updating user statuses

* Add and update tests

* Updates per feedback
2018-07-16 15:49:26 -04:00
Adrian
88eef609ab Merge consecutive text nodes when inspecting markdown (#9112)
* Fix assertion order

expected/actual were in wrong order, resulting in misleading output in
case of failing tests

* Merge consesutive markdown text nodes

This ensures that parser quirks such as "hello!" being parsed as
two separate nodes ("hello" and "!") are not exposed to code inspecting
a markdown strings.
2018-07-16 11:12:31 -04:00
Carlos Tadeu Panato Junior
940d0bbbc2 add pre-package plugins to the MM package (#9114) 2018-07-16 17:02:13 +02:00
George Goldberg
9d9fcd9ac5 MM-11172: Don't allow reacting in read-only town square. (#9106) 2018-07-16 13:04:52 +01:00
cpanato
10f571784b Merge remote-tracking branch 'upstream/release-5.1' into release-5.1-daily-merge-20180716 2018-07-16 10:00:19 +02:00