Commit Graph

1196 Commits

Author SHA1 Message Date
Jesús Espino
c82a84ed76 MM-12067: Add SetDefaultProfileImage to reset the user profile image to a generated one (#9449)
* MM-12067: Add SetDefaultProfileImage to reset the user profile image to a generated one

* Allow to get the default profile image for my user

* Allowing to reset the last update image date to 0

* PR reviews
2018-10-02 08:04:38 +02:00
Carlos Tadeu Panato Junior
ad4443d06d fix gofmt for go 1.11 (#9516)
* fix gofmt for go 1.11

* fix test

* comment out one test
2018-10-01 10:19:11 -07:00
Harshil Sharma
71e3afaf63 #MM-12130 - Fix incorrect key in en.json and changes some translations from service terms to terms of service (#9488)
* Fix incorrect key in en.json and changes some translations from service terms to terms of service

* Improved translated messages
2018-10-01 13:16:13 +02:00
Mark Vainomaa
760e200795 Bump AuthorizeRequest State max length to 1024 (#9468)
Resolves MM-12000
2018-09-27 12:17:27 -07:00
Carlos Tadeu Panato Junior
e77f9d06f5 Uncomment upgrade for 5.4.0 (#9477) 2018-09-27 16:09:21 +02:00
Harshil Sharma
af275fe924 #MM-12130 changes for custom service terms (#9450)
* #MM-12130 changes for custom service terms

* Fixed styling

* Added getServiceTerms API

* removed unnecessary panic

* removed custom service terms text from flat config

* reverted user sql store as those changes are no longer needed

* added tests

* Updated a config key to be more standard

* Added copyright info

* Loading service terms only if the feature is enabled

* Loading service terms only if the feature is enabled

* removed unused index

* added createservice termns API

* made a param to bool instead of string

* added createservice termns API

* review fixes

* fixed styling

* Minor refactoring

* removed saveConfig and loadConfig magic

* added empty service terms text check to createServiceTerms API

* refactoed some urls to be terms_of_service instead of service_terms

* removed check for support settings

* changed URLs in tests

* removed unused code

* fixed a bug

* added service termd id in conif

* fixed a test

* review fixes

* minor fixes

* Fixed TestCreateServiceTerms
2018-09-26 16:49:22 -04:00
Christopher Speller
37e00ef916 Adding paging to elasticsearch API. (#9425) 2018-09-26 10:27:04 -04:00
Jesús Espino
847f30a13b MM-11707: Change the default setting for EDIT_OTHERS_POSTS (#9447)
* MM-11707: Removes edit_others_posts permission from the team_admin role in MakeDefaultRoles().

* MM-11707: Tests fix.

* MM-11707: Update test store.

* MM-11707: Allow to change the permission for edit the others posts on TE

* Fixing tests
2018-09-24 15:35:39 +02:00
Hanzei
1463df21a5 Add ChannelId and TeamId to PostActionIntegrationRequest (#9384)
* Add ChannelId and TeamId to PostActionIntegrationRequest

* Add tests
2018-09-19 08:39:36 -04:00
Jesse Hallam
0204c45b7a Revert "disable EnablePublicChannelsMaterialization by default (#9418)" (#9427)
This reverts commit 5786b0d6d5, now that
the feature is safe to enable by default.
2018-09-18 10:53:36 -04:00
Harrison Healey
6c2a5555b8 MM-11700 Clean up handling of user display names for notifications (#9343)
* MM-11700 Clean up handling of user display names for notifications
2018-09-18 00:20:12 +05:30
George Goldberg
ab99f0656f MM-11781: Basic Data Export Command Line. (#9296)
* MM-11781: Basic Data Export Command Line.

* ChannelStore new unit tests.

* TeamStore new unit tests.

* Unit test for new UserStore function.

* Unit tests for post store new methods.

* Review fixes.

* Fix duplicate command name.
2018-09-17 15:51:26 +01:00
Jesse Hallam
5786b0d6d5 disable EnablePublicChannelsMaterialization by default (#9418)
* disable EnablePublicChannelsMaterialization by default

Creating triggers on Amazon RDS seems to reqiure extra privileges. More
investigation is required.

* update model/config.go too
2018-09-17 07:37:46 -07:00
Charles Birk
a755bcdde6 [MM-11860]: Expose slack attachment parsing functions in the model package (#9351)
Refactored parseSlackAttachment functions from https://github.com/mattermost/mattermost-server/blob/master/app/post.go#L312
into model/slack_attachments.go so that plugins have access to them.
2018-09-17 10:15:28 -04:00
FurmanovD
517faccc33 MM-11424 Extend bulk import to support themes across teams(#9305) (#9419)
* MM-11424 Extend bulk import to support themes across teams(#9305)

Also added:
Advanced Settings:
+'feature_enabled_markdown_preview'
+'formatting'
Sidebar Settings:
+'show_unread_section'

* MM-11424 (PR review) user teams' theme validator test updated

* MM-11424 (PR review) added test with valid JSON of invalid theme(by structure)

JSON string contains numeric and JSON object fields, not just a correct "string":"string" map
2018-09-17 11:46:06 +01:00
Jesse Hallam
8b17bf9e42 MM-11886: materialize channel search (#9349)
* materialize PublicChannels table

Introduce triggers for each supported database that automatically maintain a subset of the Channels table corresponding to only public channels. This improves corresponding queries that no longer need to filter out 99% DM channels.

This initial commit modifies the channel store directly for easier code reviewing, but the next wraps an experimental version around it to enable a kill switch in case there are unforeseen performance regressions.

This addresses [MM-11886](https://mattermost.atlassian.net/browse/MM-11886) and [MM-11945](https://mattermost.atlassian.net/browse/MM-11945).

* extract the experimental public channels materialization

Wrap the original channel store with an experimental version that
leverages the materialized public channels, but can be disabled to
fallback to the original implementation.

This addresses MM-11947.

* s/ExperimentalPublicChannelsMaterialization/EnablePublicChannelsMaterialization/

* simplify error handling

* move experimental config listener until after store is initialized
2018-09-13 13:47:17 -04:00
Jesús Espino
e32581aef3 MM-11725: Add specific autocomplete endpoint for search autocomplete (#9337) 2018-09-11 22:45:31 +02:00
Carlos Tadeu Panato Junior
1f87596e75 Merge release-5.3 2018-09-10 16:13:21 +02:00
George Goldberg
72258266aa MM-11649: Fix caching issue in channel API endpoints. (#9345)
This fixes an issue where the cached Channel objects would contain data
from a failed update when the update to the database failed.
2018-09-06 23:41:19 +02:00
cpanato
4cf6913c1c Merge remote-tracking branch 'upstream/release-5.3' into release-5.3-daily-merge-20180904 2018-09-04 23:27:39 +02:00
Carlos Tadeu Panato Junior
d2190527ea Uncomment upgrade for 5.3.0 (#9354)
* Uncomment upgrade for 5.3.0

* add missing version
2018-09-04 15:42:43 +02:00
n1aba
50af3a19a2 MM-11703: Update incoming and outgoing webhook description to 500 characters (#9265)
* MM-11703: Update incoming and outgoing webhook description to 500 characters

* MM-11703: Add upgrade code

* MM-11703: Remove MAX_DESCRIPTION_LENGTH constants

* MM-11703: GOFMT

* MM-11703: Move upgrade code to version 5.3

* MM-11703: Comment back upgrade to 5.3.0

* MM-11703: Add API errors back

* MM-11703: Copy-Paste
2018-09-04 13:24:41 +02:00
Daniel Schalla
531897b1f0 add megacheck as makefile target (#9288)
Fix code issues in channel_test.go

Fix Channel Test Issues detected by Megacheck

Fix API Emoji Test Issues detected by Megacheck

Fixed API Issues Reported by Megacheck

Fixed App issues reported by megacheck

Remaining fixes

removed test added by mistake from old HEAD

gofmt

Store Fixes

simplified returns

Fix test for multi member channel delete

revert to delete unused function
2018-09-03 14:08:40 +02:00
Dmitry Samuylov
effa9d33fc bug fix: after and before search flags should not be inclusive of the selected date (#9327)
* fix for date based flag support to make the after and before flags not inclusive of the selected date

* updated search posts tests using date flags to take into account new non inclusive of the selected date behavior of those flags
2018-08-29 19:44:00 -03:00
George Goldberg
e742ba7d51 Remove testing imports from non-test code. (#9324) 2018-08-29 11:08:03 -07:00
Jesús Espino
ae3865b539 MM-10532: Add EnableSyncWithLdapIncludeAuth config (#9319) 2018-08-28 19:49:01 +02:00
Dmitry Samuylov
42806ae965 Feature/search after before on (#9219)
* initial implementation of after, before, on search flags allowing to restrict the search to a specific day or a date range

* missed setting beforeDate in SearchParams in one place

* fixed condition when only flags are used for search without any plain terms

* changed date format used for after/before/on flags to be in ISO8601 format as suggested in PR comments, added a helper function to pad month and day with zeroes allowing the user user either format, with or without leading zeroes

* corrected expected compare to date setting for the TestParseDateFilterToTimeISO8601 test

* fixed a bug for the scenario when you only have the date flags without any terms, added a couple of tests for that scenario

* updated the date filter logic to use parameters to construct the query instead of simply appending strings together, as suggested in the pull request comments

* added search unit test using date flags

* added a helper function to create a test post with a createat date manually set, updated the test for search using date flags to create test posts with different createat dates to be able to better test the functionality

* MM-11817 Add support for after/before/on search flags with Elasticsearch

* add support to search posts to perform the search in context of the client's timezone when filtering by createat date using on: after: before: flags

* updated tests to match the new signature
2018-08-28 13:09:32 -04:00
Gabe Van Engel
347ee1d205 MM-11327: Restrict Teams by Email (#9142)
* Check a team's AllowedDomains setting before adding users to the team.

* Updated AddUser tests to validate AllowedDomains restriction.

* Updated variable name to match convention.

* Removed AllowedDomains from team sanitization.

* Update AppError's Where to match the calling function.

* Added tests for user matching allowedDomains, and multi domain values of allowedDomains.

* Added test to make sure we block users who have a subdomain of a whitelisted domain.

* Revert "Removed AllowedDomains from team sanitization."

This reverts commit 17c2afea584da40c7d769787ae86408e9700510c.

* Update sanitization tests to include dockerhost, now that we enforce AllowedDomains.

* Added tests to verify the interplay between the global and per team domain restrictions.

* Validate AllowedDomains property against RestrictCreationToDomains before updating a team.

* Remove team.AllowedDomains from sanitization.

* Add i18n string for the team allowed domains restriction app error.
2018-08-28 11:06:57 -04:00
Jesús Espino
19e69681d7 Adding IdAttribute setting for SAML (#9291)
* Adding IdAttribute setting for SAML

* Adding Saml Id Attribute to the diagnostics information

* Adding entry to default.json
2018-08-28 11:56:40 +02:00
Martin Kraft
ed0fb617ef MM-11786: Adds API endpoint to retrieve redirect locations. (#9284) 2018-08-24 08:49:31 -04:00
Joram Wilander
4de2e5206e Support for interactive menus in message attachments (#9285) 2018-08-24 11:16:17 +01:00
Carlos Tadeu Panato Junior
5876b52ecd Merge release-5.2 2018-08-24 11:36:39 +02:00
George Goldberg
d2945cdd77 MM-11782: Make archived channels experimental and off-by-default. (#9281)
* MM-11782: Make archived channels experimental and off-by-default.

* Fix test.
2018-08-22 21:12:51 +02:00
Hanzei
56d92de3f2 Add ToJson() to PostActionIntegrationResponse (#9247)
* Add ToJson() to PostActionIntegrationResponse

This commits adds a ToJson() methode to PostActionIntegrationResponse.

It also adds tests for other ToJson() methods

* Add PostActionIntegrationResponseFromJson function

* Add PostActionIntegrationRequesteFromJson() function

* Fix test names

* Add testcase
2018-08-20 09:21:16 -07:00
Hanzei
c2f2fda8a1 Add PostId to PostActionIntegrationRequest (#9270) 2018-08-18 08:35:32 -04:00
Jesse Hallam
d8c8a19d35 avoid t.Fatal() in tests (#9189)
I've been burned a few times by tests that simply fatal, requiring me to
run another build to learn more about what the mismatch was. Avoid this.

This is part of a long running goal of mine to make testing "better".
2018-08-09 11:26:38 +02:00
Daniel Malon
0bbabd137b Ignore link-local addresses in cluster advertisement (#9223) 2018-08-08 20:40:53 -07:00
Jesús Espino
6bf09e2c34 MM-11384: Add system install date information to the client config (#9218)
* MM-11384: Add system install date information to the client config

* Fixing translation text

* Fixes from Peer Review
2018-08-08 12:04:36 +02:00
Carlos Tadeu Panato Junior
fbdf337dcd Uncomment upgrade for 5.2.0 (#9216) 2018-08-06 09:45:36 +02: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
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
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
Christopher Speller
82dfe9e61d Adding support for code split plugins. (#9184) 2018-07-31 07:44:44 -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
Joram Wilander
6ac82d5171 Implement OAuth2 implicit grant flow (#9178) 2018-07-27 17:35:43 -04: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
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
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
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