Commit graph

113 commits

Author SHA1 Message Date
Carrie Warner (Mattermost)
dcd66d2146
MM-41988 Updated links to legacy domain about.mm.com (#19552)
* Updated links to legacy domain about.mm.com

* Legacy link updates

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* about.mm.com URL updates

* mattermost.org URL updates

* forum.mm.org URL update

* Update .github/ISSUE_TEMPLATE.md

* Update .github/ISSUE_TEMPLATE.md

* Un-deleted language files

* Update README.md

* Update tests/test-config.json

* fix some test due to url updating (#19787)

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Harrison Healey <harrisonmhealey@gmail.com>
Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
2022-03-16 19:47:57 +08:00
mkraft
7fa6b321ae
Custom groups (#18839)
* WIP

* adding initial creategroup endpoint

* fetching by group source

* fixing startup error

* updating create endpoint to take an array of user_ids, this will allow us to create the group with one request

* adding delete group endpoint and appropriate test

* adding source param for getGroups

* adding add members and delete members endpoints

* locking down crud endpoints to only be allowed for custom groups

* user search stuff

* allowing remoteid be null by changing field to pointer

* code cleanup and store level tests

* adding new tests and removing unused endpoint

* resolving conflicts

* Adds authz check for group.

* Adds authz checks to groups APIs.

* Updated create group authz tests.

* Updates delete group tests.

* Tests create group.

* Adds some tests and validations.

* adding new parameter so I can get users not in a group

* Fixed all lint warnings.

* Fix type.

* fixing search users not in group

* Fixes some lint errors.

* Moves entry in JSON array.

* Fixed SQL query.

* Fixes permission migration test.

* Fixes migration test.

* Fixes some group store tests.

* Fix test.

* Fix test.

* Revert lint change.

* Migrated CreateWithUserIds to sqlx.

* Adds tests for GetMember; migrates implementation to sqlx.

* Tests GetNonMemberUsersPage and hanles wrong group id.

* Fixes test.

* Switches GetMaster to GetMasterX.

* Switches GetReplica to GetReplicaX.

* Fixes logic.

* Fixes shadow declaration.

* Adds include_member_count to get group API endpoint.

* Adds filter_has_member param to getGroups.

* Fixes.

* Removes array of group sources.

* fixing error

* Testing reverting CreateWithUserIds back to gorp.

* Added websocket event for CreateGroupWithUserIds.

* Changed a few response status codes. Switched to correct permission.

* Added member count to ws payload for group when updating or creating.

* Adds feature flag checks for custom groups.

* Added middleware function to require license. Added config to disable custom groups.

* Change for function signature change of executePossiblyEmptyQuery.

* Lint fixes.

* Adds telemetry none comment.

* Adds translations.

* Migrated to sqlx.

* Temp. removal of translation.

* Fixed typo.

* Added an intermediary model to query with a field that is now ignored by sqlx on read queries.

* Re-used existing store struct.

* Inludes member count.

* Fix for merge error.'

* Require license for group endpoints.

* Updates translations.

* Fix shadow declaration.

* Renames permissions. Switches to new method to retrieve remoteid.

* Added WS events for upsert and delete member(s).

* Added new store error type ErrUniqueConstraint.

* Added EnableCustonGroups to the client config.

* Sanitized some user records.

* Added parameter to include_total_count for listing groups.

* Added translations.

* adding deleteAt field to getByUsers query

* Revert sanitize.

* Added uniqueness constraint error to UpdateGroup.

* Removed the FutureFeatures flag so that the feature is not enabled on old Enterprise licenses.

* Renamed function.

* Updates authz check for user search related to groups.

* Removed debug statement.

* Removed unused app method.

* Added telemetry for enable_custom_groups.

* Returns early from nil license.

* Updates test.

* Returned early to avoid nesting in (*SqlGroupStore).checkUserExist. Switched to reading from replica in (*SqlGroupStore).GetMember. Handled JSON marshal error in (*Client4).UpsertGroupMembers

* Switched to SanitizeProfile.

* Switched to model.NewInt.

* Switched from status NotImplemented to Forbidden for missing license.

* Removed deactivated users from 'exists' set.

* Revert gotool update.

* Ignored lint error that I think is invalid.

* Added the approprate access tag for disabling custom groups.

* Revert change to response status.

* Fixed refactor mistake.

* Limited the group member WS events to individual users.

* Removed WS event of deleted groups.

* Updated license check for searchUsers endpoint.

* Switched from license feature to license sku.

* Update app/group.go

Co-authored-by: Claudio Costa <cstcld91@gmail.com>

* Update app/group.go

Co-authored-by: Claudio Costa <cstcld91@gmail.com>

* Remove linter ignore comment.

* Added function to create sku-specific license.

* Fixed typo. Removed comment.

* Fixed for wrong type.

* Added missing param to client. Removed unnecessary props setting. Added test for retrieving groups by source.

* Updated some tests now that we're validating group membership not created for deactivated user.

* Fix for groups endpoint returning all group types by default.

* Changes constant names. Adds migration for all users to manage custom group members.

* Removes requirement for manage_system permission to filter user search by group.

* Added migration mock.

* Removes default permissions from custom_group_user role.

* Fixes migration.

* Fixes emoji migration test.

* fixing issue with member counts

* fixing search issue for deleted members

Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MBP.ht.home>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.fritz.box>
Co-authored-by: Claudio Costa <cstcld91@gmail.com>
2022-02-17 12:34:39 -05:00
Josh Soref
294bd44971
[GH-19267] Spelling comments (#19268)
* spelling: comments

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-01-20 10:07:27 +05:30
Devin Binnie
929caaff3d
[MM-39374] Remove DesktopLatestVersion and DesktopMinVersion (#18979) 2021-11-12 10:37:43 -05:00
Claudio Costa
0c84885132
[MM-38375] Fix processing bulk import with attachments (#18352)
* Fix improper attachments in replies

* Fix import data path

* Improve errors

* Fix importing attachments directly from zip file

* Add some test cases to cover error paths
2021-09-21 17:39:52 +02:00
Ben Cooke
3b9324b389
[MM-36444] Manage config deprecations for 6.0 (#18035)
* removing deprecated stuff

* removing deprecations and marking others for deprecations

* removing some of the configs

* partially remove ExperimentalChannelOrganization

* fixing merge issues

* moving default permissions to defaultroles function

* removing experimentaltownsquare

* removing old tests and remove legacysidebar config

* fixing test

* removing log

* removing unused variables

* MM-36444: Fix for renamed functions.

* MM-36444: go mod tidy and go mod vendor.

* MM-36444: Vendored go modules.

* MM-36444: Removes UseExperimentalGossip config field from model.

* Fix vendors

* fixing test

Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Martin Kraft <martin@upspin.org>
Co-authored-by: Claudio Costa <cstcld91@gmail.com>
2021-09-14 13:22:59 -04:00
Ben Schumacher
e0f51f54e1
[MM-23279] Idiomatic naming (IP) (#18152) 2021-08-19 10:33:29 +02:00
Claudio Costa
96593580ae
Add MaxImageResolution config setting (#17941) 2021-08-12 17:43:10 +02:00
Ben Schumacher
fd853e74a6
[MM-37755] Idiomatic naming (SMTP, TLS, TCP, XML, CSS, HTML, HTTP) (#18103) 2021-08-12 11:49:16 +02:00
Martin Kraft
21639f9c87
MM-22845: Added support for permalink previews. (#17796)
* MM-22845: Added support for permalink previews.

* MM-22845: Adds license to new file.

* MM-22845: Adds endpoint to retrieve multiple posts by id.

* MM-22845: Fix for deleted post.

* MM-22845: Adds config setting for permalink previews.

* MM-22845: Adds API test for new endpoint.

* MM-22845: Fix typo.

* MM-22845: Tests that post create or updated via App get the previewed_post prop.

* MM-22845: Tests for matching permalinks.

* MM-22845: Adds PreparePostForClient test for permalink previews.

* MM-22845: Embeds entire post in permalink metadata.

* MM-22845: Filter WS message payload of created and edited post based on permissions.

* MM-22845: Runs app layer generator.

* MM-22845: Lint check fix.

* MM-22845: Adds feature flag.

* MM-22845: Clones WS message.

* MM-22845: Removes knowledge of permalink from LinkMetadata table. Removes knowledge of user id from post embedding methods in favour of a 'sanitize' method/step.

* MM-22845: Handle nil post metadata.

* MM-22845: Switch to cloning post.

* MM-22845: Removes unused code.

* MM-22845: Refactor.

* MM-22845: Reverts whitespace change.

* MM-22845: Removes unnecessary code.

* MM-22845: Removes unnecessary function.

* MM-22845: Warn but don't error if permalinked referenced post or channel is not found.

* MM-22845: Fix for clone method.

* MM-22845: Fix for clone method.

* MM-22845: Updates translations.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-08-09 11:33:21 -04:00
Allan Guwatudde
8bfe24c774
[MM-37578] - Add setting for onboarding (#18068)
* [MM-37578] - Add setting for onboarding

* fix lint

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-08-09 08:56:10 +03:00
Jesús Espino
b9cceb70ae
Making doc extraction more reliable (#17842)
* Making doc extraction more reliable

* fix error message

* Adding test doc file

* Removing test that not works on CI because the lack of a binary

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-07-29 11:57:51 +02:00
Claudio Costa
39c3b8ebf9
[MM-29241] Image logic refactor (#17702)
* Image logic refactor

* Add missing translations

* Improve prepareImage

* Use iota

* Limit image encoder concurrency

* Unexport validation methods

* Avoid shortening on exported names

* Remove unnecessary complexity
2021-06-05 17:08:29 +08:00
Martin Raymond Kraft
58dce5930e
[MM-31094] Replication Lag (#16888)
* MM-31094: Adds tooling to develop and test using a MySQL instance with replication lag. Adds some lazy lookups to fallback to master if results are not found.

* MM-31094: Removes mysql-read-replica from default docker services.

* MM-31094: Switches (store..SessionStore).Get and (store.TeamStore).GetMember to using context.Context.

* MM-31094: Updates (store.UsersStore).Get to use context.

* MM-31094: Updates (store.PostStore).Get to use context.

* MM-31094: Removes feature flag and config setting.

* MM-31094: Rolls back some master reads.

* MM-31094: Rolls a non-cache read.

* MM-31094: Removes feature flag from the store.

* MM-31094: Removes unused constant and struct field.

* MM-31094: Removes some old feature flag references.

* MM-31094: Fixes some tests.

* MM-31094: App layers fix.

* MM-31094: Fixes mocks.

* MM-31094: Don't reparse flag.

* MM-31094: No reparse.

* MM-31094: Removed unused FeatureFlags field.

* MM-31094: Removes unnecessary feature flags variable declarations.

* MM-31094: Fixes copy-paste error.

* MM-31094: Fixes logical error.

* MM-30194: Removes test method from store.

* Revert "MM-30194: Removes test method from store."

This reverts commit d5a6e8529b.

* MM-31094: Conforming to make's strange syntax.

* MM-31094: Configures helper for read replica with option.

* MM-31094: Adds some missing ctx's.

* MM-31094: WIP

* MM-31094: Updates test names.

* MM-31094: WIP

* MM-31094: Removes unnecessary master reads.

* MM-31094: ID case changes out of scope.

* MM-31094: Removes unused context.

* MM-31094: Switches to a helper. Removes some var naming changes. Fixes a merge error.

* MM-31094: Removes SQLITE db driver ref.

* MM-31094: Layer generate fix.

* MM-31094: Removes unnecessary changes.

* MM-31094: Moves test method.

* MM-31094: Re-add previous fix.

* MM-31094: Removes make command for dev.

* MM-31094: Fix for login.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-12 12:37:30 -05:00
Agniva De Sarker
0c2c31bb0a
MM-31715: Flip ExperimentalGossip to be true by default (#16644)
* MM-31715: Flip ExperimentalGossip to be true by default

https://mattermost.atlassian.net/browse/MM-31715

```release-notes
The UseExperimentalGossip field under ClusterSettings is now true by default.
This means that new installations will use the gossip protocol for cluster communication.
There will be no changes to existing installations.
```

* update test config
2021-01-07 19:52:00 +05:30
Mario de Frutos Dieguez
94fe01dc1d
[MM-30539] New renewal link logic (#16539)
* New renewal link logic

Endpoint and logic that returns the renewal link to be used to start the
license renewal process.

* Limit access for restricted sysadmins

* Include active users in the renewal token
2020-12-18 16:40:46 +01:00
Claudio Costa
6c976c3b06
Generate preview regardless of HasPreviewImage value (#16535)
Automatic Merge
2020-12-11 00:15:17 +01:00
Claudio Costa
df906cad9d
[MM-28422] Enable processing of import files through API (#16062)
* Implement unzip function

* Implement FileSize method

* Implement path rewriting for bulk import

* Small improvements

* Add ImportSettings to config

* Implement ListImports API endpoint

* Enable uploading import files

* Implement import process job

* Add missing license headers

* Address reviews

* Make path sanitization a bit smarter

* Clean path before calculating Dir

* [MM-30008] Add mmctl support for file imports (#16301)

* Add mmctl support for import files

* Improve test

* Remove unnecessary handlers

* Use th.TestForSystemAdminAndLocal

* Make nouser id a constant
2020-12-03 11:38:00 +01:00
Jesús Espino
8d5be2d657
Document extractor service (#15665)
* Document extractor service

* Fixing vendor modules

* Addressing PR Review comments

* Some small simplifications

* Fixing a linter complain

* simplifying a bit the code using package variables

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-27 15:58:38 +01:00
Claudio Costa
73c41ef808
[MM-28638] Improve image thumbnail generation logic (#15534)
* Improve image thumbnail generation logic

* Improve naming
2020-10-09 08:47:20 +02:00
Doug Lauder
5e59b5f70c
MM-23935 extend session expiry on user activity (#14275)
* MM-23935  extend session expiry on user activity

- if user types anything before a session expires the session will be extended to now + session length

- ensures new session expiries are not written to DB too frequently

- new session store func for updating session ExpiresAt

- session length defaults for mobile and web/ldap changed from 180 days to 30 days
2020-05-06 15:41:10 -04:00
Jesse Hallam
4582823f87
fix /test command (#14169)
Automatic Merge
2020-04-18 00:08:57 -07:00
Agniva De Sarker
4210ae60ab
MM-22056: Fix flaky test TestUploadFiles (#14234)
Automatic Merge
2020-04-07 07:09:04 -07:00
Martin Kraft
4d99aa22ba
MM-22212 & MM-22208: Read from the higher-scoped scheme if the permission is non-moderated. (#13813)
* MM-22212: Read non-moderated permissions from higher-scoped scheme.

* MM-2212: Corrects test count in comment.

* MM-22212: Adds godoc comment.

* MM-2212: Switches to the channel roles check in a few more places.

* MM-22212: Refactors and fixes.

* MM-22212: Reverts change, no longer required.

* MM-22212: Removes translation.

* MM-22212: Un-comments merged new permission.

* MM-22212: Un-comments merged new permission.

* MM-22212: Performance tweak.

* MM-22212: Fixes some fmting.

* MM-22212: Add unit test for newly-added store methods.

* MM-22212: Renames app method.

* MM-22212: Re-uses existing function to find string in slice.

* MM-22212: Keeps 'higher-scoped' terminology for consistency.

* MM-22212: Refactors based on PR feedback.

* MM-22212: Fix for some bad merging.

* MM-22212: Renamed some things.

* MM-22212: Use an 'else' instead of a 'continue' for readability.

* MM-22212: Caches (*SqlRoleStore).ChannelRolesUnderTeamRole.

* MM-22212: Adds mock to new cache store.

* MM-22212: Adds missing open tracing app layer methods.

* MM-22212: Adds migration to add moderated permissions to channel_admin if present on channel_user.

* MM-22212: Migrates team schemes. Removes unused AppError.

* MM-22212: Fix for for if.

* MM-22212: Fixes iterator.

* MM-22212: Updates open tracing generated methods.

* MM-22212: Fix mocks.

* MM-22212: Change migration key name.

* MM-22212: Switched to data structure from other branch.

* MM-22212: Fixes tests after adding 'use_channel_mentions' to the channel_admin role.

* MM-22212: Adds tracking of channel moderation.

* Revert "MM-22212: Adds tracking of channel moderation."

This reverts commit 23689efa22.

* MM-22212: Switch some functions to methods and vice versa.

* MM-22212: Fix for refactor bug not notifiying websocket about changed role.

* MM-22212: Adds test for public/private 'manage_members' handling.

* MM-22122 Fix manage channel members edge case for public and private channels (#14049)

* MM-22212: Adds moderated permission to team_admin.

* MM-22212: Updates migration.

* MM-22212: Revert unnecessary update to default roles.

* Add channel scheme updated event when channel scheme is deleted or created (#14057)

* MM-22212: Adds newline.

* MM-22212: Migration fix.

* MM-22212: Fix for migration.

* MM-22212: Test fix.

Co-authored-by: Farhan Munshi <3207297+fm2munsh@users.noreply.github.com>
2020-03-23 13:44:20 -04:00
Gabriel Sagula
a1719e9fcf
MM-22707: improved image upload tests and logging (#14018)
* improved image upload tests and error logging message

Signed-off-by: Gabriel Linden Sagula <gsagula@gmail.com>

* removed unecessary logging message

Signed-off-by: Gabriel Linden Sagula <gsagula@gmail.com>

* fixed null ptr issue

Signed-off-by: Gabriel Linden Sagula <gsagula@gmail.com>

* rolled back pointer to the client

Signed-off-by: Gabriel Linden Sagula <gsagula@gmail.com>

* added hexdump of the previewer file

Signed-off-by: Gabriel Linden Sagula <gsagula@gmail.com>

* fixed tests that use the renamed files

Signed-off-by: Gabriel Linden Sagula <gsagula@gmail.com>

* addressed reviewer notes

Signed-off-by: Gabriel Linden Sagula <gsagula@gmail.com>

* addressed reviewer concerns

Signed-off-by: Gabriel Linden Sagula <gsagula@gmail.com>

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-03-17 10:20:29 +05:30
catalintomai
ed52acd89c
MM-18062 - add support for Office365Settings Directory (tenant) Id (#13737)
* MM-18062 add directory id field to O365 settings
2020-02-14 09:55:40 -08:00
Ben Schumacher
cb49d560ab
Allow plugins to specify a ReleaseNotesURL via manifest (#13677) 2020-01-28 19:33:21 +01:00
Maria A Nunez
ebfd332161
MM-21374 - Fixed extracting icon for prepackaged and local plugins (#13633)
* Merge upstream

* Added extracting iconData for prepackaged and local plugins

* Fixed tests

* Removed report.xml

Co-authored-by: Jason Paul Deland <9366595+jaydeland@users.noreply.github.com>
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-01-20 10:34:18 -05:00
Ben Schumacher
3491c3abb2
Respect HomepageURL in manifest for local plugins (#13595)
* Respect HomepageURL in manifest for local plugins

* Add documentation for updating the plugin signatures
2020-01-17 09:09:58 +01:00
Maria A Nunez
87eb7697f9
MM-19606- Rework Prepackaged Plugins (#13449)
* MM-19609 - Add new prepackage configuration settings (#13062)

* Add signatures to the prepackaged plugins (#13138)

* MM-19612 - Support querying local plugin marketplace when upst… (#13250)

* MM-19612 - Support querying local plugin marketplace when upstream unavailable or disabled

* Update translations file

* Fixed comment

* Updated to check EnableRemoteMarketplace setting and LocalOnly to get marketplace plugins

* Fixed unit tests

* Tests cleanup code

* Removed unused error message

* Updated tests

* MM-19614- Updated Marketplace Service error id (#13388)

* [MM-19610] Consume prepackaged plugins (#13005)

* consume prepackaged plugins into memory

* missing i18n

* remove spurious .gitignore changes

* return on failure to install prepackged plugins

* cleanup

* s/plugins/availablePlugins

* whitespace

* don't return extractDir when not needed

* s/plug/plugin

* error on icon, cleanup

* update armored version of testplugin signature

* honour AutomaticPrepackagedPlugins

* document getPrepackagedPlugin

* MM-19613 - Include prepackaged plugins in marketplace results (#13433)

* Added prepackaged plugins to marketplace results

* PR Feedback

* PR Feedback

* Update error where definition

* Removing unnecessary var declaration

* Updated comments

* MM-21263 - Use EnableRemoteMarketplace in marketplace install… (#13438)

* MM-21263 - Use EnableRemoteMarketplace in marketplace install endpoint

* Call updateConfig before calling NewServer in TestHelper

* Added translations

* PR feedback

* Translations

* Feedback

* s/helpers.go/download.go

* Converging env.PrepackagedPlugins

* Initial PR feedback

* Ordered imports properly

* Updated DownloadURL to return slice of bytes

* Fixed method typo

* Fixed logging

* Added read lock for prepackaged plugins list

* PR Feedback

* Added condition to only install prepackaged plugin if it was previously enabled

* Linting

* Updated to check plugin state in config

* Closing filereader

* Only add local label if remote marketplace is enabled

* Updated local tag description

* Fixed tests

Co-authored-by: Ali Farooq <ali.farooq0@pm.me>
Co-authored-by: Shota Gvinepadze <wineson@gmail.com>
Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2020-01-15 13:38:55 -05:00
catalintomai
37ce413b7d
MM-20698: Add server support for getting SAML metadata and updating S… (#13311)
* MM-20698: Add server support for getting SAMl metadata and updating SAMl settings
2020-01-09 21:25:20 -08:00
lindalumitchell
397e83f870 Remove redundant in-line image tests (#13578) 2020-01-09 14:35:47 +08:00
Shota Gvinepadze
9898f91f7e
[MM-20309] production public key (#13244)
* Add production public key

* Fix unit tests
2019-12-05 23:41:52 +04: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
Martin Kraft
598f7c7255
MM-17767: Remove ExperimentalLdapGroupSync config. (#12388) 2019-10-08 08:03:39 -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
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
Jesse Hallam
4beb1226c8
revert 0e534c8, rewriting plugin tests to use actual pugins (#11713)
Revert https://mattermost.atlassian.net/browse/MM-14559. The tests were refactored, but all the hooks were be run as:

    _, ret := hooks.MessageWillBePosted(nil, nil)

and the plugins were panicking, but then nothing was actually failing because this hook doesn't support returning a "proper" error. Good news is that the old tests are still passing, so nothing has regressed in the toolkit, but thinking we should revisit this holistically instead of trying to fix in place.
2019-07-29 10:07:00 -03: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
Sven Hüster
5690df9d95 add support for new slack post format and multiple attachments in slack importer (#11415)
* add support for new slack post format and multiple attachments

* add test for multiple attachments in imported slack posts
2019-07-11 10:47:51 +01:00
Ali Farooq
2ecca12bed MM-15452 - Add ability to override LHS icon for bot accounts (#11423)
* MM-15452 - Add ability to override LHS icon for bot accounts

* MM-15452 - Added translations

* MM-15452 - Updated GetIconImage test to check returned image

* MM-15452 - Added Delete handler for /icon endpoint, invalidating user cache on set/delete

* MM-15452 - Moved /icon routes under bot/, addressed other pr feedback

* MM-15452 - More conflict resolutoin

* MM-15452 Restoring api4/user.go

* MM-15452 - Using require as opposed to t for test assertions

* MM-15452 - Updated as per PR feedback
2019-07-06 08:56:21 +02:00
Sven Hüster
cc6c385d3e Add Slack corporate import ability (#10905)
* add support for slack corporate export data

* changed tempChannels for channel types. concat after parsing channels

* fix typo

* add fixes suggested by @lieut-data
2019-06-04 17:11:29 -04:00
Eli Yukelzon
18612bf771
MM-14874 - Google SSO: Migrate user API endpoint from Google+ API to People API (#10833) 2019-05-19 10:31:29 +03: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
Eli Yukelzon
0e534c8a49 MM-14559 Rewrite existing plugin API tests to exclusively test via actual plugin (#10494)
* initial work on rewriting test cases using the raw literal format

* split out the embedded tests into separate file and implement the test using a generic tester function

* initial work on rewriting test cases using the raw literal format

* split out the embedded tests into separate file and implement the test using a generic tester function

* moved tests to separate dir to avoid conflicts

* removed duplicate files

* added license header

* fixed plugin paths

* moved all trivial tests to separate files
created "meta-test" that scans a folder of api tests and runs them

* remove rpc tests from make

* use fileutil.FindDir instead of pwd
clean up the test files
2019-04-01 08:39:45 -07:00
Miguel de la Cruz
44887a0272
Adds elasticsearch to the user and channel autocompletion functions (#10354)
* Adds elasticsearch to the user and channel autocompletion functions

* Implement channel store GetChannelsByIds test

* Style changes and govet fixes

* Add gofmt fixes

* Extract default channel search limit to a const

* Add StringSliceDiff function to the utils package

* Honor USER_SEARCH_MAX_LIMIT on the user autocomplete api handler

* Change the elasticsearch development image
2019-03-15 17:53:53 +00:00
Jesús Espino
921504483b
Removing unnused InviteSalt config (#10446) 2019-03-15 07:06:28 +01:00
Yusuke Nemoto
1684f240e0 [MM-4819] Add MinimumHashtagLength config (#10248)
#### Summary
Add `MinimumHashtagLength` config

#### Ticket Link
#9156 
https://mattermost.atlassian.net/browse/MM-4819

#### Checklist
N/A
2019-03-11 14:09:50 +01:00
Jesse Hallam
72448d12a9
deprecate timezones.json (#10311) 2019-02-25 12:07:45 -04:00
Angela Chang
1018ead619 [MM-8421] Fix tiff preview - backend (#10170) 2019-02-21 09:06:59 +01:00