Commit Graph

805 Commits

Author SHA1 Message Date
Harrison Healey
84714f5cff Merge branch 'master' into mark-as-unread 2019-10-11 16:09:00 -04:00
Jesús Espino
c58c08283e Fixing guest invites acceptance (#12698) 2019-10-11 16:20:55 +02: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
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
Harrison Healey
033a9a8cd5 Merge branch 'master' into mark-as-unread 2019-10-08 15:54:53 -04:00
Jesús Espino
a6fdb72b19 Not allowing to use team invite links by guest accounts (#12608)
* Not allowing to use team invite links by guest accounts

* Adding needed tests

* Updating error text
2019-10-08 19:07:56 +02:00
Harrison Healey
17d9cc224a Merge branch 'master' into mark-as-unread 2019-10-03 09:20:23 -04:00
Agniva De Sarker
20ff7032a6 Fixed some ineffective assignments (#12543) 2019-10-03 15:45:27 +03:00
Harrison Healey
047aa6a76e Merge branch 'master' into mark-as-unread 2019-09-30 16:39:24 -04: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
Harrison Healey
05c2a134ac Merge branch 'master' into mark-as-unread 2019-09-20 10:11:31 -04:00
Jesús Espino
e236eb74fa Add prometheous metrics for each api handler (#12254) 2019-09-20 15:09:58 +02:00
Jesús Espino
ecbc5ef5e1 Fixing autocomplete endpoint for in/out of channels (#12147) 2019-09-18 20:27:32 +02:00
Harrison Healey
5f28ce9de0 Merge branch 'master' into mark-as-unread 2019-09-18 13:16:23 -04:00
Carlos Tadeu Panato Junior
c7b583ccdd use mkdirall instead of mkdir (#12032)
* use mkdirall instead of mkdir

* revert

* create the folder here
2019-09-18 18:39:01 +02:00
Joram Wilander
3d4c941ba8 MM-18512 Use options struct for GetProfilesWithoutTeam and add filtering to API (#12200)
* Use options struct for GetProfilesWithoutTeam and add filtering

* Fix test
2019-09-17 20:13:17 +01:00
Jesse Hallam
4ce7b92283 MM-17023: Plugin Marketplace (#12183)
* MM-17149 - Extend config.json for marketplace settings (#11933)

* MM-17149 - Extend config.json for marketplace settings

* Renamed MarketplaceUrl, tracking default marketplace url

* Added EnableMarketplace to the client config

* Revert "Added EnableMarketplace to the client config"

This reverts commit 0f982c4c66.

* MM-17149 - Added EnableMarketplace to the client config (#11958)

* Added EnableMarketplace to the client config

* Moved EnableMarketplace setting out of limited client configuration

* MM-17150, MM-17545, MM-18100 - Implement GET /api/v4/plugins/m… (#11977)

* MM-17150 - Implement GET /api/v4/plugins/marketplace proxying upstream
MM-17545 - Merge locally installed plugins into GET /api/v4/plugins/marketplace

* Replaced MarketplacePluginState with Installed

* Setting InstalledVersion instead of Installed

* marketplace client setting per_page if non zero

* Creating insecure client for marketplace url

* Fixed trailing slash for default marketplace url

* Adding filtering

* Fixed function names

* Renamed Manifest() to GetManifest(), added godoc for BaseMarketplacePlugin

* Handling plugin.ErrNotFound correctly

* Checking err == nil instead when a plugin is installed

* MM-18450 - Local-only plugin search (#12152)

* MM-17846: plugin icons (#12157)

* MM-17846: add support for plugin icons

Extend the model definitions to support plugin icons from the marketplace.

* s/IconURL/IconData

* MM-18475 - Converge on snake_case responses from the marketplace (#12179)

* MM-18520 - MM-Server should forward server version to marketplace server (#12181)

* Renamed request to filter client4.GetMarketplacePlugins

* Renamed request to filter

* Guarding against bad marketplace server response
2019-09-17 15:02:26 -04:00
Eli Yukelzon
b3517eaf2f MM-17468 - Improving performance of fetching threads (#11980)
fetchThreads parameter support in the API
2019-09-17 14:37:10 +01:00
Claudio Costa
ad9784d7e3 [MM-16934] Add API endpoint to update channel privacy (#11993)
* Add API endpoint to update channel privacy setting

* Fix language files

* Improve tests by making sure channel has been updated correctly

* Improve tests
2019-09-16 19:34:36 +02:00
Theo Gkourasas
98489b9e67 MM-15219 Add support for introduction text in interactive dial… (#12029) 2019-09-11 11:31:51 -04:00
Nikhil Ranjan
3057116581 Converting to structured logging the file api4/websocket.go (#12118) 2019-09-11 07:33:31 -04:00
Nikhil Ranjan
67f86b5a63 Converting to structured logging the file api4/system.go (#12119) 2019-09-11 07:06:52 -04:00
Harrison Healey
42e927cc3f Merge branch 'master' into mark-as-unread 2019-09-10 15:34:29 -04:00
jfrerich
1802c575e5 [MM-18119] Add methods for getting teams and count when query… (#12020)
* Add methods to handle include_total_count api parameter when permissions
for authenticated user is not sysadmin

* Add translations for app errors

* Add Mocks

* Add tests for new methods

* When running at the TeamStore testing level, the number of returned
teams is different than running tests individually.  Fix for now and
submit help wanted do proper teardown after each test

* correct value when running test at the top level

* Add helper function to delete previous teams in db

* Instead of checking against numbers of teams returned, check against the
actual teams returned.
When creating test teams, use unique DisplaName values so the return
array will be sorted consistantly.
When testing private and public team counts, add teams that should not
be counted.  Also create odd number of public/private teams for better
error protections.  Don't want 1 of each type
2019-09-10 11:50:27 -05:00
Claudio Costa
d2c3933c8e [MM-18033] Upgrade minio-go dependency (#12046)
* Upgrade minio-go dependency

* Update go.mod and go.sum
2019-09-10 09:43:51 +02:00
Miguel de la Cruz
1a9a2b1430 [MM-17219] Return an empty list instead of null when no teams (#11904) 2019-09-06 13:12:32 +02:00
threepwood-mm
f9d9dd8b60 [MM-14521] New endpoint to validate site urls (#11944) 2019-09-06 12:52:14 +02:00
Woolim Cho
b9a3c2e90e MM-10272: Add a count for pinned posts header icon (#11840) 2019-09-04 13:41:29 +02:00
Guillermo Vayá
3629f26bb9 [MM-17069]also unread the given post (#11932) 2019-09-02 10:00:38 +02:00
Daniel Schalla
a92c830e57 Add additional input validation for user creation (#11937) 2019-08-27 10:39:01 +02:00
Harrison Healey
24b80ed807 Merge branch 'master' into mark-as-unread 2019-08-23 09:54:40 -04:00
Jesper Hansen
f753819a66 [MM-17554] Health Check: improves enhanced health check with a DB write check. (#11851)
* Add db write check to enhanced ping check function (#11813)

* fix misspelling

* improve logging (#11813)

* MM-17554: update logging to uppercase

* MM17554: log DB read/write success (#11813)
2019-08-22 18:25:50 -04:00
Ali Farooq
5754ffc320 MM-17087 - Disable plugin on removal (#11779)
* MM-17087 - Disable plugin on removal

* Updated documentation

* Got reid of notifyPluginEvents

* Updated documentation

* Added plugin installation/activatoin flow as a toplevel go doc in plugin_install.go

* Generating webapp bundle on plugin installation

* Fixed shadowing issue

* Updated doc to include unguarded race condition

* Renamed GenerateWebappBundle

* Added a debug log when peers are not ready to notify

* Updated docs

* Removed extra line
2019-08-22 15:17:47 -04:00
Maria A Nunez
53f4bf1ec1 MM-17688 - Updated http timeout for plugin install from URL (#11887)
* Bumped http request timeout for plugin install from URL

* Added unit test for timeout higher than 30 seconds. Other minor PR feedback

* Fixed spacing
2019-08-22 13:33:28 -04:00
Guillermo Vayá
6b0f4f1aee [MM-17069] Api endpoint to unread a channel (#11794)
* [MM-17069] endpoint to unread a channel from post

* [MM-17069] update mock

* [MM-17069] first passing test

* [MM-17069] fix SQL typo

* [MM-17069] fix msgCount

* add tests

* [MM-17069] Fix tests

* [MM-16069] Remove trash, add comments

* [MM-16069] Add message to errors

* [MM-17069] fix go fmt

* [MM-17069] return an UnreadChannel response

* [MM-17069] added unauthorized test

* [MM-17069] fix operator

* [MM-17069] refactor tests

* [MM-16069] back to green tests

* [MM-17069] change url to include user

* [MM-17069] Fixing code review comments

* [MM-17069] One shouldn't fix manually what a machine can fix better

* [MM-17069] change response type, update tests

* [MM-17069] fix permission error

* [MM-17069] Add tests for edit_other_users permission

* [MM-17069] no magic numbers
2019-08-21 08:48:25 -04:00
Marc Argent
50011d5589 GH-11192 Move non-API OAuth endpoints from api4 to web package (#11327)
* GH-11192 WIP

* GH-11192 WIP

* GH-11192 tidy up

* GH-11192 rename handlers

* GH-11192 add TestAuthorizeOAuthApp

* GH-11192 WIP

* GH-11192 Tests mostly passing

* GH-11192 add missing closeBody function back

* GH-11192 add test api endpoint

* GH-11192 rename endpoint to oauth_test
2019-08-15 08:45:31 -04:00
Miguel de la Cruz
b36eb415d1 [MM-17213] Fix domain check when inviting guests and update user checks (#11793)
* Add update user check for guests and tests

* [MM-17213] Fix domain check when inviting guests

* Fix i18n strings

* Fix tests

* Add missing translation

* Adds test case for non guest user
2019-08-14 16:07:58 +02:00
Jesse Hallam
87c0d304c6 MM-17412: update post incorrectly removing files (#11834)
* leverage testify

* improve TestUpdatePost tests

* improve TestPatchPost

* assert unchanged fileIds after UpdatePost

* MM-17412: retain existing FileIds on post update
2019-08-12 18:36:08 -03:00
Jesse Hallam
9bb36614a6 MM-17438: allow attaching nouser files to posts (#11837)
* tweak AttachToPost formatting

* test attaching files uploaded by nouser

* MM-17438: allow attaching nouser files to posts
2019-08-12 18:35:46 -03:00
Joram Wilander
404c49f62f MM-16725 Respect env var overrides when setting config (#11821)
* Respect env var overrides when setting config

* Use strings.NewReader
2019-08-09 11:33:59 -04:00
Hanzei
20b0af446a Fix NPE when installing a plugin via URL (#11809) 2019-08-09 07:28:28 +02:00
scott lee davis
2fa63b10ec MM 7971 dockerhost -> localhost && docker -> docker-compose (#10872)
* replace dockerhost with localhost

* remove uneeded setup-max build step (no more dockerhost)

* changes as recommended by @cpanato

* make clean-docker with docker-compose

* added ports to docker-compose.yml (needed for osx).   ignore error for ldapadd (when already exists)

* add clean-old-docker to legacy.mk

* docker-compose stop instead of down for `make stop-docker`
2019-08-02 11:53:00 -03:00
Jesús Espino
ee007962f4 Restrict the creation of dms/gms to user that you can see (#11695)
* Restrict the creation of dms/gms to user that you can see

* Adding tests

* Adding tests for CreateGroupChannel api endpoint
2019-07-31 18:37:28 +02:00
Jesús Espino
0ec0616d89 Restricting team stats using the VIEW_MEMBERS restrictions (#11694)
* Restricting team stats using the VIEW_MEMBERS restrictions

* Adding tests

* fixing tests
2019-07-31 18:34:03 +02:00
Jesse Hallam
f44473e062 MM-17339: fix missing post thread (#11729)
* leverage testify for TestGetPostsForChannelAroundLastUnread

* introduce assertPostList helper

* unit test MM-17339

* fix MM-17339
2019-07-30 17:27:18 +08:00
Maria A Nunez
3187907b67 MM-16990 - Fix webhooks visible to users without viewing permissions (#11698)
* Filtered incoming webhooks for users wihtout PERMISSION_MANAGE_OTHERS_INCOMING_WEBHOOKS

* Filtered outgoing webhooks for users without PERMISSION_MANAGE_OTHERS_OUTGOING_WEBHOOKS

* Refactored GetOutgoingByTeamByUser to its own method in app and store

* Fixed paging condition for outgoing webhooks in store

* Separated test cases into separate t.run in WebhookStore

* Improved unit test. PR Feedback

* Filtered outgoing webhooks by channel for users without PERMISSION_MANAGE_OTHERS

* Filtered getting full list of outgoing webhooks for users without PERMISSION_MANAGE_OTHERS

* Added missing signature for GetOutgoingWebhooksPage in app

* Expanded permissions in test to SYSTEM_USER_ROLE

* Filtered getting full list of incoming webhooks for users without PERMISSION_MANAGE_OTHERS

* Removed unnecessary sq.and operator
2019-07-29 12:32:26 -04:00
Miguel de la Cruz
8858b15e7e [MM-17194] Add search channels for user in case the user doesn't have the list channels permission (#11706)
* [MM-17194] Add search channels for user in case the user doesn't have the list channels permission

* Add tests for the API layer and control the case of a user not being a team member

* Remove unnecessary empty line
2019-07-29 09:35:32 +02:00
Ali Farooq
f6480d1ac6 MM-16935 - Flaky test: Elastic Search IndexChannel Error (#11709) 2019-07-26 18:53:12 -04:00
Lev
52ac87ea32 MM-16997: Simplified TestUploadFiles (#11707)
* MM-16997: Simplified TestUploadFiles

Tickets:
https://mattermost.atlassian.net/browse/MM-16997
https://mattermost.atlassian.net/browse/MM-16760

- The tests now fully buffer the data vefore uploading it. The prior
  code was much more complex because it was intended to eventually
  mature into generic client code; not a priority, definitely not
  valuable for this test.
- Also improved error handling in TestHookFileWillBeUploaded for
  MM-16760

* PR feedback: typo
2019-07-26 09:54:04 -07:00
Jesús Espino
fe8a0f6485 Guest accounts feature (#11428)
* MM-14139: Creating permissions for invite/promote/demote guests (#10778)

* MM-14139: Creating permissions for invite/promote/demote guests

* Fixing tests

* Adding invite guest api endpoint (#10792)

* Adding invite guest api endpoint

* Adding i18n

* Adding some tests

* WIP

* Migrating Token.Extra info to bigger size (2048)

* Fixing tests

* Adding client function for invite guests

* Adding send guests invites tests

* Renaming file from guest to guest_invite

* Adding Promote/Demote users from/to guest endpoints (#10791)

* Adding Promote/Demote users from/to guest endpoints

* Adding i18n translations

* Adding the client functions

* Using getQueryBuilder function

* Addressing PR review comments

* Adding default channels to users on promte from guest (#10851)

* Adding default channels to users on promte from guest

* Addressing PR review comments

* Fixing merge problems

* Sending websockets events on promote/demote (#11403)

* Sending websockets events on promote/demote

* Fixing merge problems

* Fixing govet shadowing problem

* Fixing feature branch tests

* Avoiding leaking users data through websockets for guest accounts (#11489)

* Avoiding leaking users data through websockets for guest accounts

* Adding tests and fixing code error

* Fixing i18n

* Allow to enable/disable guests and other extra config settings (#11481)

* Allow to enable/disable guests and other extra config settings

* Fixing tests and moving license and config validation to api level

* Update api4/role_test.go

Co-Authored-By: George Goldberg <george@gberg.me>

* Update api4/role_test.go

Co-Authored-By: George Goldberg <george@gberg.me>

* Fixing typo

* fixing tests

* Managing correctly the guest channel leave behavior (#11578)

* MM-15134: Removing guests from teams or system on leave channels if needed

* WIP

* No deactivating the guest user when leave the last team

* Adding a couple of tests

* Fixing shadow variables

* Fixing tests

* fixing tests

* fixing shadow variables

* Adding guest counts for channel stats (#11646)

* Adding guest counts for channel stats

* Adding tests

* Fixing tests

* Fixing guest domain restrictions (#11660)

* Adding needed migration for the database

* Fixing migration
2019-07-22 22:13:39 +02:00