Commit Graph

1360 Commits

Author SHA1 Message Date
Harrison Healey
ff0696c667 MM-16228 Remove DisablePostMetadata setting (#11138)
* MM-16228 Remove DisablePostMetadata setting

* Remove DEPRECATED_DO_NOT_USE_DisablePostMetadata
2019-06-13 17:32:36 -04:00
Christopher Speller
1ca421472f Fix bots being unable to post when personal access tokens are disabled. (#11105) 2019-06-13 11:54:09 -07:00
Devin Binnie
c524ee544f [MM-14727] Modified App.Bot.CreateBot to create a new post to the bot… (#11062) 2019-06-13 13:36:13 +02:00
Jesús Espino
969c032a1e MM-15325: Allowing to configure the device for detect the IP in HA clusters (#10917) 2019-06-11 20:53:03 +02:00
Guillermo Vayá
ad69002f9e Truncate data from OpenGraph metadata (#10532)
* Truncate strings from OpenGraph metada

* remove unwanted opengraph fields, limit to 1 image

* test helper functions

* Add truncating test

* fix typo

* change test into not comparing for the pointer value

* truncate only once

* only shorten fields that were already present

* set maximum of 5 images

* fix original tests

* fix test

* limit to 5 images

* fix typo

* place functions below types, simplify function commentaries

* Rewrite how to empty opengraph's structure
2019-06-11 17:39:35 +02:00
Eli Yukelzon
c243b6640c MM-14712 - Add support for signing SAML requests (#11081)
* SAML Request signing added
* added telemetry for signrequest flag
2019-06-11 14:14:15 +03:00
Christopher Speller
69076934ec Adding bot description field to bot users. (#11066) 2019-06-07 08:09:34 -07:00
Eli Yukelzon
6a42ad2af5 [MM-14400] Programmatically generate default.json (#10551)
* create/update config.json using go generate

* added default config generator
added config-reset to Jenkins and make package, updated defaults to consider 'isNew' flag

* corrections after code review

* fixed Config.isValid to handle empty encryption keys

* fixed Config.isValid to handle empty encryption keys

* fixed Config.isValid to handle empty encryption keys

* isUpdate now only checks for nil

* Addressed review comments, added unit testing for default config generator

* err shadowing

* license

* provide output file for config generator via ENV variable, since go generate doesn't support arguments and we need two output paths (config-reset and package)

* cleanup

* proper defaults for PushNotificationServer and SendPushNotifications

* corrected generating defaults for TrustedProxyIPHeader to be consistent with default.json in master

* Check for empty SiteURL as well as nil

* corrected SiteURL settings and checking

* crazy typos fixed

* corrected tests to newly expected values

* relaxed the checks

* fixed formatting
2019-06-06 13:57:01 -04:00
Christopher Speller
f39dd28b72 Upgrading schema version to 5.12.0 (#11043) 2019-06-03 14:41:53 -07:00
Miguel de la Cruz
74997a126e Change ES trace config type from boolean to string (#11019) 2019-05-31 17:25:11 +01:00
Miguel de la Cruz
6aba17ff9d [MM-15637] Add Trace config option to the Elasticsearch block (#11008) 2019-05-30 16:48:19 +01:00
Jesús Espino
bb2e52ee68 Migrate Groups to not use the Layered store (#10946) 2019-05-28 15:17:10 +01:00
Jesús Espino
fb237cc624 Migrate User.Update method to sync by default (#10942) 2019-05-28 09:40:29 +02:00
Tsilavina Razafinirina
c05cf5b033 [MM-11287] Add support for plus sign and period/dot in custom URL schemes (#9155) (#10852) 2019-05-25 21:47:06 +02:00
Daniel Schalla
2d97f01781 [MM-15639] Add config setting to explicitly define which IP headers are trusted (#10907)
* Add config setting to explicitly define which IP headers are trusted

* fix variable shadowing

* Optimize code flow; Add Ratelimit test for header set

* Extend Ratelimit tests

* Add additional unit tests

* Structured logging
2019-05-24 20:22:13 +02:00
Martin Kraft
e8af4872c6 MM-15422: Adds new parameters for retrieving pages of channels. (#10903)
* MM-15422: Adds new parameters for retrieving pages of channels and searching channels.

* MM-15422: Appends excluded channel names with defaults. Adds separate struct for data-tier option parameter.
2019-05-24 11:28:42 -04:00
Jesús Espino
124b371312 Add support for tracing in LDAP (#10920) 2019-05-24 09:55:07 -04:00
Andres Orozco
88005fbf54 MM-15662: Rename "CreateBotAccounts" config.json setting to "EnableBotAccountCreation" (#10875)
* MM-15662 change conflig flag to EnableBotAccountCreation

* undo changes to i18n

* MM-15662: Change config flag for bot creation

adds newline to i18n

* MM-15662 Update diagnostics.go to use new config flag
2019-05-23 13:03:22 -07:00
Eli Yukelzon
e59674cfdd MM-14721 - Add an identifier for compliance exports when a message is posted by a bot account (#10908) 2019-05-23 13:33:18 +03:00
Daniel Schalla
d269891476 [MM-15490] Rework default password requirements (#10844)
* Rework default password requirements

* Update API Test Lib Default User PW

* Remove unused function; Disable password reqs in dev mode

* Disable strict password requirements for unit tests

* Update unit tests
2019-05-21 11:03:36 -07:00
Martin Kraft
8d8a4d8614 MM-15485: In-channel system behaviour for at-mentions and slash commands for group-constrained channels. (#10855)
* MM-15108: Prevent non-group-members from being added to group-constrained channels.

* MM-15485: Updates ephemeral message when non-group member is invited to group-constrained channel.

* MM-15485: Prevent group-permitted members from being removed from group-constrained channels. Show custom ephemeral when attempting /kick or /remove.
2019-05-17 12:43:19 +01:00
Miguel de la Cruz
098dbc84cc [MM-14751] Adds group_constrained filter to user list and search endpoints (#10678) 2019-05-16 10:12:06 +01:00
Martin Kraft
1b78f9debc MM-14897: Changes to be able to add and remove groups from channels. (#10794)
* MM-15162: Changes for LDAP groups removals phase.

* MM-14897: Changes to be able to add and remove groups from channels.

* Update model/client4.go

* MM-14897: PR-requested change to string interpolation.
2019-05-15 12:03:47 -04:00
Carlos Tadeu Panato Junior
9559de26cc update db to 5.11 (#10826) 2019-05-15 16:58:48 +02:00
Daniel Schalla
3bb11d747d Add Error and Help to reserved name list (#10845) 2019-05-14 22:18:32 +02:00
scott lee davis
ae951f6449 MM-14722 - Don't let bots create other bot accounts (#10808) 2019-05-14 22:15:23 +02:00
Elias Nahum
5b252e8736 Tracking Push Notifications in a structured logger (notifications.log) (#10823)
* Remove NotificationRegistry table and use structured logging

* Fix ackId for notification sent

* Notification logger at server level

* Remove unused i18n strings
2019-05-13 07:53:46 -07:00
Andres Orozco
30061df036 MM-14723: Add config flag for creating bots (#10795)
* MM-14723 add config flag for creating bots

* MM-14723 - update i18n to handle new config flag

* MM-14723 - change API tests to allow bots by default

* Update i18n/en.json

Co-Authored-By: andresoro <ao15@my.fsu.edu>

* MM-14723: add config flag for enabling/disabling bot creation

* undo changes to apitestlib.go to explicitly change config in each test

* add unit tests for config changes

* MM-14723 update test cases

* MM-14723 update test cases to use UpdateConfig method
2019-05-13 07:48:32 -07:00
Martin Kraft
480fffd3cc MM-15162: Changes for LDAP groups removals. (#10701)
* MM-15162: Changes for LDAP groups removals phase.

* MM-15162: Adds missing translation.

* MM-15162: Fixes tests.

* MM-15162: Removes some confusing branching.

* MM-15162: Make permission less restrictive.

* MM-15162: Moves counting to the DB tier.

* MM-15162: Moves CountGroupsByTeam into own store method.

* MM-15162: Adds count to tests.

* MM-15162: Fix for wrong cast type.

* MM-15162: Fix for possible null SchemeGuest column.

* MM-15162: Fixes bug whereby permissions error didn't return.

* MM-15162: Changes for LDAP groups removals phase.

* MM-15162: Adds missing translation.

* MM-15162: Fixes tests.

* MM-15162: Removes some confusing branching.

* MM-15162: Make permission less restrictive.

* MM-15162: Moves counting to the DB tier.

* MM-15162: Moves CountGroupsByTeam into own store method.

* MM-15162: Adds count to tests.

* MM-15162: Fix for wrong cast type.

* MM-15162: Fix for possible null SchemeGuest column.

* MM-15162: Fixes bug whereby permissions error didn't return.

* MM-15162: Adds missing translation blocking enterprise build.

* MM-15162: Update to group commands.
2019-05-10 11:47:21 -04:00
Michael Kochell
43e95b0b2b [MM-13507] Plugin framework: auto-restart plugins that crash (#10781)
* introduce plugin health check

* implement plugin health check job

* add support for checking pid of plugin process and RPC ping, to determine a plugin's health

* implement restart policy with back-offs

* support "EnableHealthCheck" boolean from config file.

* add tests for supervisor.PerformHealthCheck() and shouldDeactivatePlugin()

* improve error handling. clean up if blocks to be more concise
2019-05-09 13:08:31 -07:00
Siyuan Liu
fc15eda37f [MM-14719] convert users to bots through cmd (#10672)
* [MM-14719] convert users to bots through cmd

* address review comments, add / fix unit tests

* change command from "modify" to "convert"; review comments

* code review comments, clean up
2019-05-06 07:59:51 -07:00
Elias Nahum
e6be06b3fc MM-14289 & MM-14884 Push notification acknowledge id and include sender name (#10736)
* MM-14289 Add Push notification acknowledge identifier and store tracing logs

* MM-14884 include SenderName property in Push Notifications

* Remove @ sign from channel Name in push notifications

* Fix i18n

* Fix push notification model

* fix TestPostNotificationGetChannelName

* Remove colon from model constant

* Fix Notification Registry tests

* Make postId optional for clear notifications

* Update http status when service is not available

Co-Authored-By: enahum <nahumhbl@gmail.com>
2019-04-30 18:15:29 -04:00
Harrison Healey
e50b642e43 MM-14030 Add format and frame count to image metadata (#10757)
* MM-14030 Add initial CountFrames

* MM-14030 Add format and frame count to image metadata

* Fix tests and stop using image dimensions from OpenGraph

* Fix copyright header

* Move license to NOTICE.txt
2019-04-30 16:45:26 -04:00
Jesús Espino
584ec68755 MM-15021: Adding new builtin system schema for Guests (#10601)
* MM-15021: Adding new builtin system schema for Guests

* Fixing tests

* Setting properly the permissions

* Adding guests to sampledata

* Restrict more roles updates in the app layer for guests

* Adding comment to explain that permissions migration must go at the end

* Setting the default guest role for custom scheme during migration

* Fixing import and export

* Creating scheme guest roles on migration

* Fixing tests

* Fixing tests

* Fixing tests
2019-04-30 20:36:21 +02:00
Jesús Espino
c8920588a0 Adding new "VIEW_MEMBERS" permissions restrict the scope of users visibility (#10487)
* MM-14138: Adding new "VIEW_MEMBERS" permissions restrict the scope of users visibility

* Fixing gofmt

* Fixing broken tests

* Addressing PR review comments from Miguel de la Cruz

* Removed hack

* A bit nicer and cleaner code in the UserBelongsToChannels function

* Adding cluster cache invalidation for user team ids

* Checking in the correct order permissions to not leek existency information

* Adding restrictions to TeamMembers and User status requests

* Fixing tests

* Fixing status endpoint permissions checks

* Adding more tests

* Fixing tests

* More tests and making the restrictions query based only on joins

* Adding more tests

* Adding more tests

* fixing merge problems

* Reverting status changes to avoid performance issues

* Adding more tests

* Fixing test

* i18n extract

* Adding extra method for get restrictions for a team

* Add the new elasticsearch functions to search users with restrictions

* Add missing translation string

* Rename restrictedChannelIds to restrictedToChannels

* Remove ToDo

* Adding the permission to the SystemAdmin role during permissions migrations
2019-04-29 16:56:56 +02:00
Daniel Schalla
f7982216e4 [MM-13671] Rework Team InviteId Creation and Updates (#10536)
* Add regenerate invite ID endpoint; Dont allow inviteID updates via other methods; Remove unrequired checks in get handler

* Fix tests; Dont accept TeamId as invite ID

* Ensure all teams have an InviteID set

* Custom Selector to get empty teams; dont crash when inviteid set fails

* Remote InviteId from TeamPatch

* Add missing translation

* Translation string order

* Use sync store

* gofmt
2019-04-25 23:09:38 +02:00
Puneeth Reddy
ec95793b90 MM-15276: Migrate Team.Update to sync by default (#10693)
* MM-15276: Migrate Team.Update to sync by default

* MM-15276: Addressing review comments and change Update func signature similar to other interface Update method

* update store mocks for update fn

* addressing review comments
2019-04-25 15:29:02 +02:00
Joram Wilander
b24013d54c MM-14882 Filter out inactive users from out of channel/group mentions (#10685)
* Add FilterByActive to UserSlice type

* Filter out inactive users from out of channel/group mentions
2019-04-25 08:45:03 -04:00
Gabe Jackson
be4b473aee Move to the mattermost/go-i18n fork (#10669)
This change is being made to address an issue where the go-i18n
translation library would result in partial-translations when a
given language dictionary was missing a given plural keyword. The
improvement made here leads the translation library to try an
'other' keyword lookup if the first plural keyword fails to have
a value.

This change was not accepted upstream due to concern regarding
changing the behavior, so we are using a fork at this time to
address the issue.
2019-04-23 09:33:42 -04:00
Harrison Healey
2b6691e5cc MM-14741 Add default option to post action dropdown (#10659) 2019-04-22 08:57:54 -07:00
Martin Kraft
84a59ddb39 MM-14417: Messaging for mentions of users who are not in associated channel groups. (#10594)
* MM-14417: Adds support for out-of-channel notifications of users who are not in associated groups of group-constrained channels.

* MM-14417: Fix for mobile backwards compatibility.
2019-04-17 10:44:45 -04:00
Lev
f93ba3cd23 MM-14795 Added "from_webhook" to protected props in DoPostAction (#10593)
Per @hanzei's request https://github.com/mattermost/mattermost-server/pull/10546#issuecomment-481997493
https://mattermost.atlassian.net/browse/MM-14795
2019-04-11 16:35:29 -07:00
Joram Wilander
2d4d19837b Remove LogSettings.FileFormat after it was accidentally added back (#10569) 2019-04-09 12:42:24 -04:00
Jesús Espino
43fa7e0548 Adding the client part of the new endpoint to invalidate email invites (#10561) 2019-04-09 11:55:39 +02:00
Daniel Schalla
7c9837d9b1 [MM-14846] Update EditAt for FileIds and Attachment in Post + Ignore FileIds Updates (#10540)
* Set EditAt for FileIds and Attachments; Disallow update/patch of FileIds in API Handler

* Add custom comparison methods for StringArray and Post Attachments

* gofmt

* Split up comparison function to child structs

* Naming consistency

* gofmt
2019-04-04 20:01:21 +02:00
Lev
7272864bea Fixed MM-14627, was incorrectly removing props from updated post (#10545)
* Fixed MM-14627, was incorrectly removing props from updated post

- Fixed the wrong initialization of `remove`
- Consolidated the list of properties to retain in `model.PostActionRetainPropKeys`
- Added a test

* Not sure why this broke the test, reverted the change
2019-04-02 15:13:27 -07:00
Miguel de la Cruz
2ce48aa6d1 Adds the endpoints and store logic to get groups by team and by channel (#10502)
* Adds the endpoints and store logic to get groups by team and by channel

* Remove TODO comments

* Fix unit tests
2019-04-02 21:02:51 +01:00
Martin Kraft
25fd962016 MM-14412: Enables force removals of team/channel members base on group constraints. (#10490)
* MM-14412: Enables force removals of team/channel members base on group constraints.

* Renames some existing methods and variables.

* Change return types to ChannelMembers and TeamMembers for some existing methods.

* Adds option to change LDAP_DATA to either 'qa' or 'test' with env variable.

* Adds methods to retrieve ChannelMembers and TeamMembers that, based on group constraints, should be deleted.

* Adds helper functions to create GroupTeams and GroupChannels.

* MM-14412: Switches to helper methods for GroupSyncable creation in test files.

* MM-14412: Style fix.

* MM-14412: Switches remaining GroupSyncable instances to be created with helper functions.

* MM-14412: Typo fix.

* MM-11412: Build fixes.

* MM-14412: Checks if user is team member before re-adding.

* MM-14412: Update for change of GroupConstrained fields type.
2019-04-02 09:22:50 -04:00
Jesús Espino
4c8bac38bb MM-14243: Remove any unused PERMANENT_DELETE_USER permission (#10516) 2019-03-29 16:33:40 +01:00
Martin Kraft
020ba82cdb MM-14768: Switches field type from sql.NullBool to a bool pointer. (#10526) 2019-03-29 09:42:25 -04:00