Commit Graph

826 Commits

Author SHA1 Message Date
Martin Kraft
14bcd1f0a1 MM-18357: Adds pagination to team search. (#12910)
* MM-18357: Adds pagination to team search.

* MM-18357: Adds new client method for paginated requests.

* MM-18357: Adds feedback about non-supported pagination-permissions combo.

* MM-18357: Removes unnecessary conversion.

* MM-18357: Removes paginate parameter and uses nil on page and perpage instead.
2019-11-28 08:11:02 -05:00
Doug Lauder
5abbe50258 MM-8607 Add ability to turn off non-critical services when under load (#13212)
* MM-8607: add ability to turn off non-critical services under load

* server busy invalid param unit tests

* MM-8607: rename server busy endpoints

* MM-8607: handle case where App not initialized

* MM-8607: additional unit test cases per feedback.

* MM-8607: use decorator to check isbusy when adding endpoint route

* MM-8607: rename endpoints, use struct for json

* Update api4/system.go

Fix misspelled log output

Co-Authored-By: Saturnino Abril <saturnino.abril@gmail.com>

* MM-8607: fix i18n order; max seconds for server busy expiry
2019-11-27 20:41:09 -05:00
Elias Nahum
3e9cd464de MM-20347 Move ID Loaded Push Notifications to E20 (#13185)
* Move ID Loaded Push Notifications to E20

* Fix model tests
2019-11-21 19:35:19 -03:00
Miguel de la Cruz
f7e93db512 [MM-16768] Add support for Elasticsearch v7 (#12537)
* [MM-16768] Add support for Elasticsearch v7

* Fix i18n

* Adds external services tracking to the telemetry

* Rebuild elasticsearch interface mock

* Rename diagnostics keys

* Fix merge change
2019-11-21 13:04:21 +01:00
Harrison Healey
de913e7537 Merge branch 'master' into mark-as-unread 2019-11-19 09:45:03 -05:00
Ali Farooq
a6e992ae74 MM-16368 - Plugin Signing (#13017)
* [MM-18757] POST handler for `/plugins/marketplace` (#12372)

* Implement installMarketplacePlugin

* Add InstallMarketplacePlugin endpoint

* Fix go.mod

* merge with master

* Fix go.mod

* Fix plugin tests

* Move get plugin to marketplace client

* Fix stylistic concerns

* Add trailing newline to the go.mod

* [MM-16586] Add plugin signature settings (#12390)

* 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

* Add public key settings to the config.json

* Rename PublicKeys to SignaturePublicKeyFiles

* Change filepath.Split to Base

* Remove additional prints

* Force extention of a public key file

* Remove config validation

* Remove error on delete

* Remove config cloning

* Add error messages

* Add plugin public key tests

* Rename extension to PluginSignaturePublicKeyFileExtention

* Remove EnforceVerification

* Change []*PublicKeyDescription to []string

* Change .asc extension to .plugin.asc

* Change ordering of public methods

* Change plugin key commands

* Update examples in the plugin key commands

* Remove forcing extention

* Add verify signature in settings

* Fix tabbing

* Fix naming

* Remove unused text

* Remove unused text

* Update command examples

* Fix unit tests

* Change errors.New to errors.Wrap

* Fix verbose flag

* Change .asc to .gpg

* Fix }

* Change AddPublicKey signature

* Change public.key extension

* Add plugin public key command tests

* Update en.json

* Bootstrap the public keys

* Update en.json

* Fix en.json

* Fix en.json

* Bootstrap hard-coded public key

* Remove unused texts in en.json

* Change file to name

* Add license header

* Update development public key

* Remove writeFile method

* Remove .plugin.asc extension

* Rename publiKey to mattermostPublicKey

* Remove init_public_keys string

* GolangCI

* Closing file handlers

* Fixed test that was installing nps plugin

* [MM-19798] Implement plugin signature verification (#12768)

* 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

* Add public key settings to the config.json

* Rename PublicKeys to SignaturePublicKeyFiles

* Change filepath.Split to Base

* Remove additional prints

* Force extention of a public key file

* Remove config validation

* Remove error on delete

* Remove config cloning

* Add error messages

* Add plugin public key tests

* Rename extension to PluginSignaturePublicKeyFileExtention

* Remove EnforceVerification

* Change []*PublicKeyDescription to []string

* Change .asc extension to .plugin.asc

* Change ordering of public methods

* Change plugin key commands

* Update examples in the plugin key commands

* Remove forcing extention

* Add verify signature in settings

* Fix tabbing

* Fix naming

* Remove unused text

* Remove unused text

* Update command examples

* Fix unit tests

* Change errors.New to errors.Wrap

* Fix verbose flag

* Change .asc to .gpg

* Fix }

* Change AddPublicKey signature

* Change public.key extension

* Add plugin public key command tests

* Update en.json

* Bootstrap the public keys

* Update en.json

* Fix en.json

* Fix en.json

* Bootstrap hard-coded public key

* Remove unused texts in en.json

* Change file to name

* Add license header

* Implement plugin signature verification

* Remove benburker openpgp

* Update en.json

* Update development public key

* Add support of multiple signatures in filestore

* Update en.json

* Run go mod vendor

* Fix style

* Remove writeFile method

* Remove .plugin.asc extension

* Rename publiKey to mattermostPublicKey

* Verify plugin with mattermost public key

* Remove init_public_keys string

* Add InstallPluginWithSignature method and  Refactor

* Add signature verification on claster notification

* Remove armored signature headers

* Add error strings

* Fix en.json

* Change signatureStorePath

* Implement minor fixes

* Refactor plugin install methods

* Add installPlugin method to uploadPlugin

* Update en.json

* Refactor installPlugin

* Limit number of signatures

* Close signatures

* Fix helper function

* Fix fromReadCloseSeekerToReadSeeker

* Cleaned up ReadCloseSeeker for signatures

* Remove signature truncation on FS

* GolangCI

* Add tests for armored signatures and plugin uploads

* Fix nil slice issue

* Fix TestPluginSync

* Fixed tests

* Return io.ReadSeeker from downloadFromUrl

* Add log for the found plugins in the file store

* Remove logging plugin detection info

* [MM-20134] Consume and store single-signature for each plugin (#13081)

* Consume and store single-signature for each plugin

* Fix en.json

* Remove saveSignature method

* Remove public key hash

* PR Feedback

* refactored config

* PR feedback
2019-11-18 19:02:41 -05:00
Miguel Alatzar
d44d563ef3 [MM-16232] ID loaded push notifications (#13137)
* Update BuildPushNotificationMessage (#12974)

* Update BuildPushNotificationMessage

* Included Category, Version, and Type

* Remove unnecessary function args

* [MM-16232] Build and return fetched notification (#13085)

* Build and return fetched notification

* Remove check on PushNotificationContents

* Ran i18n-extract

* Get UserId from session

* Re-add ReturnStatusOK

* Remove UserId from PushNotificationAck

* Always include channel name

* [MM-16232] Return after writing response and add default message (#13127)

* Return after writing response and add default message

* Include channel ID as well

* Localize default message

* Fix i18n
2019-11-18 15:42:51 -08:00
Jesse Hallam
2571d97723 MM-18517: Plugin Marketplace (Phase 2) (#13086)
* MM-17549: use StatusNotFound when deleting plugin (#12983)

Trying to delete a plugin that does not exist should fail with a 404, not a 400.

Relates-to: https://mattermost.atlassian.net/browse/MM-17549

* MM-19630: marketplace: model ReleaseNotesURL (#13083)

Automatic Merge

* MM-20065: allow prepackaged plugin upgrade (#13076)

* MM-20065: allow prepackaged plugin upgrade

When locally installing prepackaged plugins, skip if a plugin exists with the same id and is the same or a newer version.

This is effectively a "poor man's" rework of prepackaged plugins to allow upgrade of prepackaged plugins via the marketplace. The larger plan to rework prepackaged plugins was deferred from v5.18.

Fixes: https://mattermost.atlassian.net/browse/MM-20065

* eliminate unnecessary installPlugin

* fix TestPluginSync defaults to match minio

* cleanExistingBundles

* close prepackaged filereader

* simplify
2019-11-18 13:40:49 -04:00
Jesús Espino
7031f51b41 Deactivating and invalidating sessions of guest users on guest disable (#13007)
Automatic Merge
2019-11-15 09:43:52 -05:00
Hossein Ahmadian-Yazdi
1ed1a6be0b [MM-19740] Return error for non-system-admins/team admins/channel admins from the GET /api/v4/groups API endpoint response (#12961)
* [MM-19740] Differentiate between admin and non-admin

* [MM-19740] added testing admin and non admin

* [MM-19740] Address PR comments

* [MM-19740] Addressed PR comments

* [MM-19740] Updated en.json

* [MM-19740] Addressed PR comments

* Address PR comments

* Address PR comments
2019-11-14 09:21:23 -05:00
Harrison Healey
3f99923ed4 Merge branch 'master' into mark-as-unread 2019-11-13 15:33:47 -05:00
Scott Bishel
a1f9705c33 MM-19866: Remove Digest setting (#13013)
Automatic Merge
2019-11-13 08:54:02 -05:00
Harrison Healey
df7cbcb440 Merge branch 'master' into mark-as-unread 2019-11-12 14:20:50 -05:00
Scott Bishel
53ee077cfd MM-18005: Improve display message when attempting to add an outsider to a group-synced team via new team invite flow (#12966)
* Update group errors being returned

* update based on merge, error already added

* remove unnecessary translation

* Revert "remove unnecessary translation"

This reverts commit 5a4ae89618.

* remove unnecessary translation
2019-11-10 08:07:49 -07:00
Harrison Healey
47409aaa4b Merge branch 'master' into mark-as-unread 2019-11-04 15:04:28 -05:00
Gervasio Marchand
1db045bce3 MM-16822 - Implement KVSetWithOptions (#11818)
* Add SetWithOptions

* Avoid passing two structs to the functions

* Rename ExpiryInSeconds -> ExpireInSeconds

* Use t.Run for the tests

* Fix build

* Address feedback

* Update log message

* Update docs and use KVSetWithOptions in KVCompareAndSetJSON

* Improve code style

* Use struct instead of pointer to struct

* Fix minimum server versions

* Update documentation

* Address feedback

* Revert new implemention of kv helpers

* Adress feedback
2019-11-04 13:49:54 +01:00
Amy Blais
3a1deeaac5 Update en.json (#12684) 2019-11-04 13:47:23 +01:00
Harrison Healey
fa34be4aa0 Merge branch 'master' into mark-as-unread 2019-10-31 09:15:41 -04:00
Shota Gvinepadze
b208bbc43e [MM-18830] Unhelpful error message when adding bot to a channel before adding to team (#12844)
* Fix error message

* Rename User to Username

* Add '@' to the username
2019-10-31 12:49:50 +04:00
Harrison Healey
eb36329e8d Merge branch 'master' into mark-as-unread 2019-10-29 10:11:41 -04:00
Ben Schumacher
fdcda20fe4 Cleanup dead code (#12929)
* Cleanup dead code

* Remove unneeded translation string
2019-10-28 19:12:50 +01:00
Hossein Ahmadian-Yazdi
b9329d1984 [MM-13704] Updated CLI "deleter user" to also permanently delete GroupMembers associated to user (#12858)
* [MM-13704] Updated CLI to set DeleteAt in groupmemebrs

* [MM-13704] Updated Mock Test

* [MM-13704] Refactored to use current pattern to write function

* [MM-13704] Small text change

* [MM-13704] updated translation

* [MM-13704] Updated params of error function

* [MM-13704] Fixed confusion between channel and group store

* [MM-13704] Addressed PR comments

* [MM-13704] Added test case

* [MM-13704] Fixed err declaration
2019-10-24 17:31:17 -04:00
Harrison Healey
6a5b264624 Merge branch 'master' into mark-as-unread 2019-10-15 12:10:55 -04:00
Scott Bishel
06866952b6 MM-16861: Support Guest Authentication via AD/LDAP (#12690)
* Add config settings for LDAPSettings GuestFilter

* make error unique

* Update model/config.go

Co-Authored-By: Martin Kraft <martin@upspin.org>

* add LdapSetting isempty_guest_attribute to diagnostics.go
2019-10-14 11:38:17 -06:00
Harrison Healey
84714f5cff Merge branch 'master' into mark-as-unread 2019-10-11 16:09:00 -04:00
Scott Bishel
3f6f44f34c MM-16860 Support Guest Authentication via SAML (#12622)
* add GuestAttribute setting

* Add Constant

* add isdefault_guest_attribute to diagnostics.go

* revert changes to go.mod

* revert changes to LdapInterface.go

* revert changes to LdapInterface.go

* revert changes to LdapInterface.go
2019-10-10 11:37:57 -06: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
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
Scott Bishel
cee19b0332 MM-18013 Allow configuration of SAML crypto hashing algorithms (#12362)
* MM-18013 Add SAML Algorithms to config.

* set defaults to current values, add validation for settings

* update to use simplier config entry
2019-09-27 12:13:31 -06:00
Harrison Healey
67f57dd3e7 Merge branch 'master' into mark-as-unread 2019-09-25 09:06:45 -04:00
Scott Bishel
1de5f29de4 MM-17620 - Web: Error when entering an invalid MFA token is unclear (#12238) 2019-09-24 06:43:40 -06:00
Harrison Healey
5f28ce9de0 Merge branch 'master' into mark-as-unread 2019-09-18 13:16:23 -04: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
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
Nikhil Ranjan
d9fa46e0a2 Converting to structured logging the file store/sqlstore/post_… (#12087) 2019-09-12 21:02:14 -04:00
Elias Nahum
3618947094 MM-18066 Remove double @ for email notifications (#12131)
* Remove double @ for email notifications

* Fix tests
2019-09-11 17:30:35 -03: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
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
Elias Nahum
d1f0216c22 Remove @ sign from app.notification.subject.direct.full translation (#11990)
* Remove @ sign from app.notification.subject.direct.full translation

* Fix uni test
2019-08-30 11:14:01 +09:00
Harrison Healey
600cf71ee9 Merge branch 'master' into mark-as-unread 2019-08-26 16:36:51 -04:00
Miguel de la Cruz
b8fa36cb41 [MM-17200] Adds specific messages when guest is added or joins a channel (#11803)
* [MM-17200] Add user joined as guest message

* [MM-17200] Add user added to channel as guest messages
2019-08-26 12:02:45 +02:00
Harrison Healey
24b80ed807 Merge branch 'master' into mark-as-unread 2019-08-23 09:54:40 -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
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
Harrison Healey
e7c58dcba3 MM-17492 Update error message for CustomURLSchemes setting (#11895) 2019-08-19 10:15:50 -04:00
Devin Binnie
9562917734 [MM-16677] New unsupported browser page (#11858)
* Added OSVersion to unsupported browser template (and some test code)

* [MM-17569] Working prototype (not functional) of unsupported browser page

* WIP

* WIP

* [MM-17571] Unsupported browser page template logic

* WIP

* [MM-17572][MM-17573] Added browsers and tested for unsupported under IE and Safari

* Clean-up

* Added missing license header

* Fixed a test

* Blank commit to force CI update

* PR feedback

* oops
2019-08-15 14:30:40 -04:00