Commit Graph

10197 Commits

Author SHA1 Message Date
Harrison Healey
99cf15b56e Update serverside markdown parser to respect unicode and capitalized links (#9235) 2018-08-08 12:13:04 +02:00
Carlos Tadeu Panato Junior
935f0c5ff9 Add preparatory upgrade code for 5.3.0 (#9224) 2018-08-08 11:35:51 +02:00
Elias Nahum
9bf01f1401 translations PR 20180802 (Adds Romanian) (#9210)
* translations PR 20180802

* Fix romanian translation
v5.2.0-rc2 v5.2.0-rc1
2018-08-06 11:13:46 +02:00
Carlos Tadeu Panato Junior
fbdf337dcd Uncomment upgrade for 5.2.0 (#9216) 2018-08-06 09:45:36 +02:00
Martin Kraft
30ded2489f MM-11510: Adds delete at value to delete channel websocket event. (#9217) 2018-08-04 12:58:41 +02:00
Jesse Hallam
04749027f6 MM-11575: change plugin nil semantics (#9212)
* change MessageWillBePosted nil return semantics

* change FileWillBeUploaded nil return semantics

* use LogDebug to verify plugin inputs vs. the confusing Delete(User|Team)
2018-08-03 13:15:51 -04:00
Jesús Espino
1ecb98d9f5 Idiomatic error handling on team sql store (#9201) 2018-08-03 17:13:50 +02:00
Jesús Espino
61f98d92fa MM-11576: Allow to join and add members to archived channels (#9214) 2018-08-03 17:13:02 +02:00
Jesús Espino
8cc4f27f7c MM-11529: Allow to Leave an archived channel from the API (#9204)
* MM-11529: Allow to Leave an archived channel from the API

* Remove the restriction to remove user from archive channel to yourself
2018-08-03 10:44:32 +02:00
dmitrysamuylovpharo
7a731d2bd1 Feature/fileinfo create copy (#9198)
* Initial implementation of a CopyFileInfos function that creates new FileInfo objects copied from provided FileIds with the provided user as the creator and not linked to a post yet. This can subsequently be used to copy existing attachments from another post to attach to a new post without having to re-upload the actual files

* added a unit test for the CopyFileInfos function

* resolving pull request suggestions
2018-08-02 10:37:31 -04:00
Elias Nahum
b728b16f90 send channel wide push notification type when at-here is used (#9209) 2018-08-02 09:40:46 -04:00
Christopher Speller
c8013d4982 Remove accidential dependency (#9203) 2018-08-01 15:38:56 -07:00
Daniel Schalla
2936dc87d0 CSRF Token Implementation for Plugins (#9192)
deleted test config

fix test config

Dont wipe the session token for plugins

Simplified Tokens; Generate CSRF for other sessions

Remove CSRF from Access Token; Remove Getter/Setter from Context

fix removed setter

remove getcsrf helper from plugin api

enforce csrf only for cookie auth
2018-08-01 15:16:04 -07:00
Jason Blais
90e84d76ef Update LICENSE.txt to include plugin/ under Apache License v2.0 (#9205)
We are removing the mention of the webapp/ directories as they have been moved to their own repository that is entirely under Apache License v2.0.

https://mattermost.atlassian.net/browse/MM-11430
2018-08-01 12:34:03 -07:00
Harrison Healey
c34b30a6e7 MM-11521/MM-11522 Fix being able to create users with invalid emails through API (#9199)
* MM-11522 Fix being able to create users with invalid emails through API

* Ensure store tests are using valid emails

* Add missing license header

* Remove invalid test case

* Fix TestUpdateOAuthUserAttrs
2018-08-01 15:18:14 -04:00
amyblais
a8cc646eed Update NOTICE.txt (#9197)
* Update NOTICE.txt

* Update NOTICE.txt

* Update NOTICE.txt
2018-08-01 12:11:25 -07:00
Jason Blais
b59044e889 Add missing diagnostics for v5.2 (#9200)
* Update diagnostics.go

* Fix gofmt
2018-08-01 11:17:24 -07:00
Harrison Healey
ecfba2c2e9 MM-11175 Add logic to server to understand markdown images with dimensions (#9159) 2018-08-01 11:43:58 -04:00
Jesús Espino
d81a61398d Migrate all the api4 to handle errors in idiomatic way (#9143) 2018-08-01 16:55:18 +02:00
Jesús Espino
1f168263a2 Split app/import.go in multiple files (#9179) 2018-08-01 15:45:26 +02:00
der-test
f4fdd7835b Fixed inconsistencies (#9120)
* Fixed inconsistencies

See https://pre-release.mattermost.com/core/pl/339m9zipst8n7kc19fossntose

* Update en.json
2018-08-01 07:41:17 -04:00
Elias Nahum
be8b6177e3 translations PR 20180730 (#9191)
* translations PR 20180730

* Fix japanese
2018-08-01 07:40:19 -04:00
Jesse Hallam
0788cdcadf MM-11420: plugins: compute bundle hash on load (#9172)
* plugins: compute bundle hash on load

Use this hash to bust client caches whenever the plugin bundle changes.

* eliminate redundant pluginHandler

* switch to 64-bit FNV-1a

* Fix test
2018-07-31 16:29:52 -04:00
Jesús Espino
8c56f52d17 Migrate notification_push_test to table testing (#9195) 2018-07-31 20:29:57 +02:00
George Goldberg
a6c364822a MM-11516: Check channel ID in URL param and Body are same. (#9185) 2018-07-31 14:13:44 -04:00
Christopher Speller
82dfe9e61d Adding support for code split plugins. (#9184) 2018-07-31 07:44:44 -07:00
George Goldberg
8766690c81 MM-10502: Only cluster master should run job schedulers. (#9174)
* MM-10502: Only cluster master should run job schedulers.

* Use sync.Map for thread safety.

* Fix tests.
2018-07-31 07:40:23 -07:00
Jesse Hallam
fcb4ee935e gob register AppError (#9182)
This allows plugin hooks to return the result of calling the API as an
`error`.
2018-07-31 10:34:40 -04:00
Joram Wilander
867416b0e6 Add OAuth2 login hint for SAML (#9194) 2018-07-31 07:29:19 -07:00
Joram Wilander
709101c4df Save OAuth access token to DB for consistency with other flows (#9190) 2018-07-31 08:40:48 -04:00
Joram Wilander
cff9ac0df8 Add siteURL to WS origin check (#9183)
* Add siteURL to WS origin check

* Handle subpath

* Only add site URL if not *
2018-07-30 17:21:57 -04:00
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