Commit Graph

310 Commits

Author SHA1 Message Date
Ashish Bhate
7602dc0b19 [MM-25647]: ability to permanently delete users (#14944)
Summary:
    Config option to allow permanent user deletion ServiceSettings.EnableAPIUserDeletion
    Expose permanent user deletion through API
    Local mode for delete user for use in mmctl

Ticket Link:
    Server part of https://mattermost.atlassian.net/browse/MM-25647
2020-07-22 17:32:23 +05:30
Miguel de la Cruz
918fc1d45c Add socket client4 creation function to the model package (#15067)
Automatic Merge
2020-07-21 15:13:35 +02:00
Ibrahim Serdar Acikgoz
6a4e3293f8 [MM-25648] api4: add user/bot convert endpoints (#14877)
* api4: add user/bot convert endpoints

* api4: add convert user/bot to local mode

* api4: fix linting issues

* api4/bot: reflect review comments

* api4: update convert user endpoint paths

* remove shadow decl

* fix translation problems
2020-07-17 10:00:43 +03:00
Ibrahim Serdar Acikgoz
bf664997a7 [MM-21464] api4/channel: add ability to force move channel by removing non-members (#14887)
* api4/channel: add ability to force move channel by removing non-members

* app/channel: add log to move channel for non taget team members

* app/channel: add tets for remove non-team members for channel

* Update api4/channel_test.go

Co-authored-by: Eli Yukelzon <reflog@gmail.com>

Co-authored-by: Eli Yukelzon <reflog@gmail.com>
2020-07-16 11:26:19 +03:00
Ibrahim Serdar Acikgoz
ec78168242 [MM-25651] api4/ldap: add migrateid (#14794)
* api4/ldap: add idmigrate

* api4/ldap: add migrateid to local api

* api4/ldap: improve migrate test

* api4/ldap: add licence check
2020-07-14 15:59:35 +03:00
Harrison Healey
de6a57cdc3 Sidebar V2 Phase 2 (#14967)
* parent 48256721c4 (#14358)

author Eli Yukelzon <reflog@gmail.com> 1585814774 +0300
committer Eli Yukelzon <reflog@gmail.com> 1589111022 +0300

Sidebar caregories implemented

Apply suggestions from code review

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>

Update store/sqlstore/channel_store.go

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>

Update store/sqlstore/channel_store.go

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>

code review suggestions

status messages

edge case

bugs...

timeout reverse

* MM-25126 Add a separate default sorting method for categories (#14575)

* MM-25158 Add user to initial sidebar categories when joining team (#14570)

* MM-25281  Place new categories in the correct position (#14609)

* MM-25277  Return channels that aren't in a category as part of the Channels/Direct Messages categories (#14601)

* MM-25276  Remove categories when leaving a team (#14600)

* Remove categories when leaving a team

* layers

* corrected cleanup function

* lint

* .

* corrected errors in postgres

* .

* MM-25280  Ensure that the "update category order" API call only contains real category IDs and isn't missing any IDs (#14626)

* Ensure that the "update category order" API call only contains real category IDs and isn't missing any IDs

* tests

* correct status code

* MM-25278  Change "update category" API to return 400 when changing unsupported fields (#14599)

* MM-25279  Change category migration to only populate channels in Favorites (#14627)

* MM-25157 Add API to delete custom categories  (#14574)

* MM-25157 Add API to delete custom categories

* get categories fix

* maxorder fix

* Use correct websocket event when deleting category

* Fix tests and remove debug code

* Actually use the right websocket event this time

* test cleanup

* Update test for new category order

Co-authored-by: Eli Yukelzon <reflog@gmail.com>

* MM-24914 Various fixes for sidebar channel handling (#14756)

* Fix checking for channel membership when reordering channels

* Remove unique constraint on SidebarCategories

* Set column sizes for SidebarCategories and SidebarChannels tables

* Allow changing the sorting method for non-DM categories

* Fix nil pointers in error handling

* Fix orphaned channels from other team being returned in Channels category

* Fix non-orphaned channels being duplicated in the Channels category

* Remove unique constraint on SidebarChannels

* Fix category/name of favorites preferences

* Fix testSidebarChannelsMigration

* Rename err to nErr and appErr to err

* Fix channel order returned by GetSidebarCategories on MySQL

* Fix adding/removing favorites preferences

* Remove leftover TODO

* Change SidebarCategoryType enums to use full names (#14786)

* Change SidebarCategoryType enums to use full names

* Fix Channels constant

* Remove leftover debug code

* MM-24914 Fix updateCategory endpoint returning the wrong type (#14795)

* MM-24914 Make some changes to UpdateSidebarCategories (#14806)

* Fix orphaned DMs not always being returned

* MM-24914 Make some changes to UpdateSidebarCategories

* Run updateSidebarCategoryOrderT in a transaction

* Fix deleting SidebarChannels based on order of arguments to UpdateSidebarCategories

* bump for api testing

* bump for api testing

* Change CreateInitialSidebarCategories to return a plain error

* Change MigrateSidebarCategories to return a plain error

* Remove usage of UpdateColumns when updating sidebar categories (#14843)

* Remove usage of UpdateColumns when changing category order

* Add a random test case

* Remove usage of UpdateColumns when updating sidebar categories (#14843)

* Remove usage of UpdateColumns when changing category order

* Add a random test case

* Remove usage of UpdateColumns when updating sidebar categories (#14843)

* Remove usage of UpdateColumns when changing category order

* Add a random test case

* MM-26343 Make CreateInitialSidebarCategories idempotent (#14870)

* Fix bad merge

* Fix another bad merge

* Fix unintentionally removed i18n string

Co-authored-by: Eli Yukelzon <reflog@gmail.com>
2020-07-06 18:20:35 -04:00
Ashish Bhate
af8b914c6c MM-23596: Ability to list private channels for team (#14925)
Summary:
store, app, api and go driver support for listing private channels

Ticket Link:
https://mattermost.atlassian.net/browse/MM-23596
2020-07-06 12:34:29 +05:30
Michael Kochell
11bc28b5fb [MM-26532] Support "active" filter on profile search (#14923)
* Support "active" filter on profile search

* Add tests for active user filter
2020-06-29 15:52:46 -04:00
Miguel de la Cruz
eff2209a7e [MM-25646] Adds the permanent delete all users endpoint to the local API (#14903)
* [MM-25646] Adds the permanent delete all users endpoint to the local API

* Add a check to ensure that teams and channels are not deleted

* Fix linter

* Fix audit record name for consistency with method name

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-06-27 23:00:01 +02:00
Ibrahim Serdar Acikgoz
f7f1f0d268 [MM-23721] api4/user: add verify user by Id endpoint (#14244)
* api4/user: add verify user by id method

* Update api4/user.go

Co-Authored-By: Miguel de la Cruz <miguel@mcrx.me>

* Update model/client4.go

Co-Authored-By: Miguel de la Cruz <miguel@mcrx.me>

* api4/user: reflect review comments

* Update api4/user_test.go

Co-authored-by: Miguel de la Cruz <miguel@mcrx.me>

Co-authored-by: Miguel de la Cruz <miguel@mcrx.me>
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-06-26 16:08:01 +03:00
Ibrahim Serdar Acikgoz
124014ad9c [MM-23719] api4/channel: add move channel to a team endpoint (#14246)
* api4: add move channel method

* api4: add tests for move channel, model: add move channel to client4.go

* add api.channel.move_channel.type.invalid message

* model/client4: remove a redundant line

* api4/channel: add tests for gm and private channel types

* app/channel: update move channel comment

* app/channel: add extra check if a users joins to channel during movement

* app/channel: log errors for post move channel

* app/channel: remove deactivated members by default while moving a ch.

* model/client: update move channel command

* fix vet errors

* app/channel: add missing webhook updates

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-06-22 16:57:49 +03:00
Martin Kraft
6158e91308 MM-25261: Add 'include_deleted' parameter to get all channels API req… (#14721)
* MM-25261: Add 'include_deleted' parameter to get all channels API request.

* MM-25261: Adds test for deleted channels.

* MM-25261: Switches to single liner.

* MM-25261: Adhere to beta config setting for viewing archived channels.

* MM-25261: Test fix.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-06-19 16:53:37 -04:00
Farhan Munshi
77bee1d4f1 MM-25263 Add group members to search and get users and create getGroupStats endpoint (#14733)
Add tests for SearchInGroup
2020-06-18 10:22:35 -04:00
Attila Molnar
66597d0fcb Expand Plugin and REST APIs to trigger user typing event (#14331) 2020-06-16 11:41:05 +02:00
Jesús Espino
e0edd2bebb Add trial license api (#14603)
* Initial request trial api creation

* Adding test license public certificate

* Adding go client method

* Applying changes to use production environment

* Removing accidentally added strings

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-06-02 21:34:15 +02:00
Martin Kraft
c529d5190a MM-25040: Restrict associated groups to channels when team is group-constrained. (#14619)
* MM-25040: Only return team-associated groups if the team is group-constrained.
MM-25040: Prevents associating a group to a channel if the team doesn't have the group first.

* MM-25040: Fix lints.

* MM-25040: Still add the groupteam if the team is not group-constrained.

* MM-25040: Wraps groupteam upsert in else branch for efficiency.

* MM-25040: Removes unnecessary page iteration.

* MM-25040: Fix typo.

* MM-25040: Moves filtering to SQL.

* MM-25040: Updates tests, check pagination.

* MM-25040: Fix lint error.

* MM-25040: Adds some more group store tests.

* MM-25040: Fix for wrong test parameter.
2020-05-29 10:46:52 -04:00
Martin Kraft
e83cc7357c MM-24517: Add newly created channel admin role to all clients' redux state. (#14635)
* MM-24517: Add newly created channel admin role to redux state.

* MM-24517: Adds comment; fixes lint errors.
2020-05-28 14:38:27 -04:00
Claudio Costa
91f010b8b7 Fix client4.GetPluginStatuses() (#14629)
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-05-25 21:07:09 +02:00
Arianna Vespri
2135096d88 Convert bool string comparisons to strconv.ParseBool for REST parameters (#13650)
* Convert bool string comparisons to strconv.ParseBool for REST parameters

* Log failed bool conversions

* Rename errors, changed log levels

* drop strconv.ParseBool error handling

If the query string parameter is omitted, strconv.ParseBool returns an error for the empty strings, which spams the logs. Instead, just assume the default semantics of a `false` return value if an error occurs.

* allow randomized Client4 booleans

It's hard to test api4's handling of the various boolean input values
accepted. Extend Client4 with support for overriding how it builds those
strings, and pick a random value on test startup.

* gofmt -s

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
2020-05-24 05:01:31 +08:00
Shota Gvinepadze
43e606173b [MM-20684] Slash Command Autocomplete (#14557)
* [MM-20684] Initial implementation of the Command Autocomplete (#13602)

* Implement Autocomplete Data

* Change CommandName to Trigger

* Fix Autocomplete test

* Make stylistic changes

* Rename a bunch of fields and methods

* Fix variable names, safer type assertions

* [MM-20684] plugin autocomplete implementation (#14259)

* Add an endpoint for command autocomplete suggestions

* Add full Suggestion to the AutocompleteSugestion struct

* Add Dynamic Argument support

* Tidy up things

* Fix missed test case

* Add support of the named arguments

* Update autocomplete API

Fix review issues

Implement dynamic args as a local request

* Fix ineffassign

* Add support of the uppercase letters in arguments

* Add support of the optional arguments

* Remove ineffectual assignment

* Add support for icons (#14489)

* Address couple of nits

* Add comment to IconData

* Add types to all consts

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-05-21 12:24:56 +04:00
Agniva De Sarker
15ed9a8f20 MM-25006: Fix occurences of unclosed http bodies (#14521)
* MM-25006: Fix occurences of unclosed http bodies

And while here, we also use ioutil.Discard to read the remaining
body instead of reading with ioutil.ReadAll which allocates a separate
byte buffer.

* Fix mistake

* Address review comments

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-05-20 08:41:37 +05:30
Miguel de la Cruz
0154b8059b [MM-20979] Add first implementation of the Bleve search engine (#14562)
* [MM-20979] Add first implementation of the Bleve search engine

* Fix i18n

* Migrate searchengine utils tests

* Fix linter

* Don't add allTermsQ if both termQueries and notTermQueries are empty

* Fix test that should work if user is system admin

* Modify naming according to review comments

* Abstract getIndexDir function

* Extracting bleve engine name as a constant

* Merge both Indexer interfaces into one

* Add worker stopped message

* Allow worker to be started/stopped with config change

* Use constants for index names

* Modify test order

* Fix linter

* Trying to unlock the CI
2020-05-20 01:29:55 +02:00
Scott Bishel
80c846412d MM-24692: Add a since parameter to getGroups api (#14444)
* add a since parameter to getGroups api

* update for lint error

* when using since, return deleted groups as well.

* update flaky test, groups have same create time

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-05-07 14:35:09 -06:00
Scott Bishel
bdd0e9febb MM-24694: Add getGroupsByUserId to API layer (#14443)
* add getGroupsByUserId to API layer

* update for lint errors

* add check for contextId = userId or ManageSystem Permission

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-05-07 13:35:56 -06:00
Shibasis Patel
882b0324b5 MM_22682_Centralize_ID_Validation (#14237)
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-05-07 13:27:35 -04:00
Jesús Espino
224b72c61e MM-24037 Adding getKnowUsers API endpoint (#14332)
* Adding getKnowUsers API endpoint

* Adding i18n strings

* Fixing golint errors

* Adding doc strings

* Remove debug line

* Updating app_iface

* Fixing gofmt
2020-04-28 12:52:43 +02:00
Farhan Munshi
036f9384b4 [MM-23264] Get channel member counts by group (#14068)
* MM-23264 Add api endpoint for get groups with members in channel

Add store tests

Add tests for api func

Gofmt

Apply changes from code review

* MM-23264 Make store layers

* MM-23264 Check read permission on channel member counts

* Trigger CI
2020-04-24 17:12:54 -04:00
Doug Lauder
26310720be MM-23724 add RestoreTeam endpoint (#14297)
* MM-23724 add RestoreTeam endpoint
* assert added to unit test
2020-04-20 22:40:22 -04:00
Doug Lauder
98c6401f54 MM-23722 add endpoint for modify team privacy (#14287)
* MM-23722 add Rest API for updating team privacy
* unit tests for UpdateTeamPrivacy
2020-04-20 21:09:40 -04:00
catalintomai
b90f4f46e2 MM-23015: Enable or disable group mentions (#14010)
* MM-23015: Enable or disable group mentions + show them in suggestion list


Co-authored-by: Catalin Tomai <catalin.tomai@mattermost.com>
2020-04-13 11:37:29 -07:00
Doug Lauder
8e5b626854 MM-23747 fix Sprintf linter errors (#14196)
- replace all instances of `fmt.Sprintf("whatever")` with simply "whatever".

- replace all instances of `fmt.Println(fmt.Sprintf("whatever %d", i))` with `fmt.Printf("whatever %d\n", i)`
2020-03-31 16:50:06 -04:00
Hossein Ahmadian-Yazdi
bd2c1f4522 [MM-21517] Team Member Manage User Modal not display correct roles (#14043)
* join on the users table and order by username

* don't inclue users who have been deleted

* Address PR comments

* update tests

* fix linting

* fix linting

* include ExcludeDeletedUsers flag

* fix gofmt

* fix nil teamMembersGetOptions

* fix gofmt error

* Add Unit Tests

* fix gofmt bugs

* partially address comments

* fix incorrect import

* Address Comments and fix golint errors

* store mocks

* address PR comments about tests and styling

* Update model/team_member.go

Co-Authored-By: Jesse Hallam <jesse.hallam@gmail.com>

* Address PR comments

* update client function name

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
2020-03-30 10:48:03 -04:00
Doug Lauder
398a12329a MM-20913 add client API Client.GetServerBusy to fetch server busy state and timeout. (#13986)
* MM-20913 add client API to fetch server busy state and timeout

* deprecate current API that only returns timeout
* required for mmctl MM-20913

* restore deleted unit test for GetServerBusyExpires

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-03-06 11:37:07 +01:00
Farhan Munshi
79c786bc0c [MM-22206] Add PATCH channel moderations (PUT /moderations/patch) (#13845)
* MM-22205 Add get channel moderations endpoint

* MM-22206 Add patch channel moderations endpoint

Add api tests for patch channel moderations

* MM-22205 Ensure ordered permissions returned and create struct ChannelModeratedRoles

* MM-22206 Use structs instead of map

* MM-22206 Add test cases for GetChannelModeratedPermissions

* MM-22206 Add tests for ChannelModeratedPermissionsChangedByPatch

* MM-22206 Use NewBool instead of defining booleans

* MM-22206 Tie Channel Mentions to Create Posts when building Channel Moderations

* Revert "MM-22206 Tie Channel Mentions to Create Posts when building Channel Moderations"

This reverts commit a0bfc95f17.

* MM-22206 Review changes

Modify GetSchemeRolesForChannel to return named variables
Change calls to SessionHasPermissionToChannel to SessionHasPermissionTo
Add a CreateChannelScheme method
Add a DeleteChannelScheme method
Move GetChannelModeratedPermissions to Role model

* Fix lint

* Add ChannelModeration methods to App interface

* MM-22206 Rename method to GetTeamSchemeChannelRoles

* MM-22206 Check CHANNEL_MODERATED_PERMISSIONS_MAP for existing permission before iterating through it

* Modify wording to higherScoped to match #13813

* MM-22206 Delete channel scheme between tests

* MM-22206 Fix tests

* Actually patch role

* MM-22206 Shadow declaration of err
2020-03-05 10:04:34 -05:00
Mario de Frutos Dieguez
a43439dd60 Include deleted channels on get user channels endpoint (#13877) 2020-03-02 22:15:15 +01:00
Doug Lauder
40b7790318 MM-21727 add an endpoint to move a command to another team (#13624)
* MM-21727 add an endpoint to move a command to another team

* endpoint
* mock / client
* unit tests

* MM-21727 PR feedback, addressed nits

* MM-21727 remove CommandMove base route

* MM-21272 replace TeamId struct with CommandMoveRequest struct

* MM-21727 fixed typo in CommandMoveRequest struct name

* MM-21727 return not-found for all getCommandById calls

* MM-21727 ensure no command ids leak

* when calling GetCommandById with invalid id return not_found
* when checking perms to manage commands for team return same not_found
* update unit tests to check for not_found

* MM-21727 Rename TeamIdFromCommandMoveRequestJson -> CommandMoveRequestFromJson
2020-01-29 11:56:21 -05:00
Eli Yukelzon
4b39d8487b MM-20977 - Inviting multiple users with valid/allowed and inva… (#13779) 2020-01-29 12:56:59 +02:00
Doug Lauder
28ec291910 MM-19250 - new endpoint to retrieve command by id (#13598)
* MM-19250 add endpoint to retrieve command by id

* endpoint
* client
* unit tests

* MM-19250 update comment; remove redundant unit test

* MM-19250 rename GetCommand to GetCommandById

* MM-19250 don't filter on autocomplete flag

* MM-19250: require team_id when using GetCommandById

* team_id added to endpoint query string for GET
* unit test to check for mismatch teamid param and command teamid

* Revert "MM-19250: require team_id when using GetCommandById"

This reverts commit ed78e27964.

* MM-19250 don't leak existence of id when user doesn't have perms

* return 404 not_found when id not found
* return 404 not_found when id exists but user missing perms to view team
* return 404 not_found when id exists but user missing perms to manage commands

* MM-19250 fix typos in comments

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-01-24 09:32:56 -05:00
Doug Lauder
173c4abb0d MM-21071 (#13564)
* replace endpoint `POST server_busy/clear` with the more RESTful idiomatic `DELETE server_busy` to clear the busy flag
2020-01-21 16:48:50 +01:00
Eli Yukelzon
e77ef9733c MM-20977 - Inviting multiple users with valid/allowed and inva… (#13372) 2020-01-14 15:29:50 +02:00
Rajat Varyani
51a61f6bc1 [MM-19720] Expose endpoint for config patch (#12997) 2020-01-14 13:06:17 +01:00
Martin Kraft
605040c597 MM-20644: Add users to teams as a SchemeAdmin based on a new configuration field on GroupTeams and GroupChannels records. (#13361)
* MM-20644: Add users to teams as a SchemeAdmin based on a new configuration field on GroupTeams and GroupChannels records.

* MM-20644: Adds SchemeAdmin to mapping of the GroupSyncable struct fields.

* MM-2064: Adds test to ensure SchemeAdmin field value is mapped.

* MM-20644: Adds missing index creation for fresh DBs.

* MM-20644: Duplicates UpdateMembersRole across Team and Channel stores. Adds tests.

* MM-20644: Fixes some old method name references.

* MM-20644: Moves variable declaration; removes Println statement.

* MM-20644: Use a SQL query instead of two to update Team and Channel members.

* MM-20644: Fixes tests; updates query.

* MM-20644: Fix permission check for patching a group syncable.

* MM-20644: Fixes test for change of permissions verification in group patch API request.

* MM-20644: Fix for ORM select vs insert.

* MM-20644: Linting fixes.

* MM-20644: Fixes some tests.

* MM-20644: Skips changing the role of guests.

* MM-20644: Added syncableID filtering
2020-01-10 09:19:39 -08: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
Jesús Espino
a63684fcb5 Consistent license message for all the go files (#13235)
* Consistent license message for all the go files

* Fixing the last set of unconsistencies with the license headers

* Addressing PR review comments

* Fixing busy.go and busy_test.go license header
2019-11-29 12:59:40 +01:00
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
Martin Kraft
0212845385 MM-18356: Adds ability to paginate channel search. (#12830)
* MM-18356: Adds ability to paginate channel search.

* MM-18356: Minor refactor.

* MM-18356: Adds doc.

* MM-18356: Fixes doc.

* MM-18356: Some commentary, adds the total count to non-paginated responses, and removes a stray fmt.

* MM-18356: Fixes shadowed variable.

* MM-18356: Removes paginate field and API parameter.

* MM-18356: Adds method to check if channel search is a paginated request.

* MM-18356: Vet fix.
2019-11-19 11:38:49 -05: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
Harrison Healey
df7cbcb440 Merge branch 'master' into mark-as-unread 2019-11-12 14:20:50 -05:00