Commit Graph

500 Commits

Author SHA1 Message Date
Christopher Speller
1e5c432e10 MM-10702 Moving plugins to use hashicorp go-plugin. (#8978)
* Moving plugins to use hashicorp go-plugin.

* Tweaks from feedback.
2018-06-25 12:33:13 -07:00
Jesse Hallam
dd35ad43ca MM-10370: serve subpath (#8968)
* factor out GetSubpathFromConfig

* mv web/subpath.go to utils/subpath.go

* serve up web, api and ws on /subpath if configured

* pass config to utils.RenderWeb(App)?Error

This allows the methods to extract the configured subpath and redirect
to the appropriate `/subpath/error` handler.

* ensure GetSubpathFromConfig returns trailing slashes deterministically

* fix error 404 handling

* redirect /subpath to /subpath/

This is necessary for the static handler to match, otherwise none of the
registered routes find anything. This also makes it no longer necessary
to add trailing slashes in the root router.
2018-06-21 11:31:51 -07:00
Jesús Espino
344836dfb2 Add missed translations (#8959) 2018-06-19 19:40:26 +02:00
Harrison Healey
226d4b2ac8 MM-6992 Added highlighting to elasticsearch results (#8861)
* MM-6992 Added highlighting to elasticsearch results

* Added a unique type for post search matches

* Fixed Elasticsearch matches not being sent through API
2018-06-19 11:46:29 +02:00
Harrison Healey
6d8140337e MM-8701 Limit the number of client config fields sent before user logs in (#8954)
* MM-8701 Limit the number of client config fields sent before user logs in

* Fixed missing client config field

* Reduced duplication between limited and regular client config
2018-06-18 12:39:22 -04:00
Corey Hulen
656c8a62d1 Prototype for CBA (#8475)
* Prototype for CBA

* Fixing gofmt issues

* Do not require password if logging in with certificate

* Fixing issues from feedback

* Adding unit tests

* Fixing feedback
2018-06-12 10:16:39 -07:00
Carlos Tadeu Panato Junior
3bae67489f Relese5.0 merge master 20180608 (#8933)
* Add missing diagnostics (#8911)

* Update diagnostics.go

* Update diagnostics.go

* Fix push notification styling backwards compatibility (#8913)

* MM-10803: remove premature user sanitization on deactivation (#8926)

* remove unused UpdateNonSSOUserActive

* MM-10803: stop prematurely sanitizing users on deactivate

This change was preceded by the removal of UpdateNonSSOUserActive to
ensure there are no APIs relying on the sanitized return value.

* MM-10803: test websocket events after UpdateUserActive

* MM-10264: Adds system scheme to permissions import/export. (#8924)

* MM-10264: Adds system scheme to permissions import/export.

* MM-10264: Switches to more likely unique name.

* MM-10264: Changed collision prevention string.

* MM-10264: Rolls back created schemes in all error cases.

* MM-10264: Test fix for more rollback cases.
2018-06-08 17:04:17 +02:00
lisakycho
e09b3c566b Get the count of the all system users at endpoint /users/stats (#8847)
* Get the count of the all system users at endpoint /users/stats

* Added GetTotalUsersStats test in api4

* Changed pluralization and added the test back.
2018-06-07 12:45:49 -04:00
George Goldberg
0c4078b6b0 MM-9730 & MM-9729: Missing Server PRs (#8908)
* MM-9730: API endpoint to update scheme-derived roles of TeamMembers.

* MM-9729: API to update scheme-derived roles of ChannelMembers.
2018-06-05 07:41:03 -04:00
Christopher Speller
2c75247c97 MM-10348 Adding experimental hardened mode. (#8881)
* Adding experimental hardened mode.

* Sanitizing all 500 errors.
2018-06-04 09:48:26 -07:00
Saturnino Abril
312edbe531 [MM-10718] Move custom branding to TE (#8871)
* move custom branding to TE
* move brand's enterprise code to server and remove BrandInterface
2018-06-02 06:33:59 +08:00
Martin Kraft
260d7a0f85 MM-10412: Adds deleteBy prop to posts. (#8896) 2018-06-01 12:45:46 -04:00
George Goldberg
516a097e1a MM-10757: Default roles from scheme should be keyed by name not ID. (#8894)
* MM-10757: Default roles from scheme should be keyed by name not ID.

* Update permissions import/export.
2018-06-01 12:49:02 +01:00
Jesús Espino
e88fe4bb1d MM-8853: Adding MANAGE_EMOJIS and MANAGE_OTHERS_EMOJIS permissions (#8860)
* MM-8853: Adding MANAGE_EMOJIS and MANAGE_OTHERS_EMOJIS permissions

* MM-8853: Removing unnecesary emoji enterprise feature

* Create emojis migration

* Adding MANAGE_EMOJIS and MANAGE_OTHERS_EMOJIS always to system admins

* Simplifing permissions checks

* Revert "Simplifing permissions checks"

This reverts commit e2cafc1905.
2018-05-29 15:58:12 +01:00
Jesús Espino
bf4cefc349 Allow to update the teams scheme to default scheme (#8855) 2018-05-29 09:32:07 +01:00
Martin Kraft
c180cdbd1c Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2 2018-05-28 10:35:27 -04:00
Saturnino Abril
c37d153ffb [MM-10519] Send websocket event whenever the channel has changed it's type (public|private) (#8798)
* send websocket event whenever the channel has changed it's type (public|private)

* updated per comment

Signed-off-by: Saturnino Abril <saturnino.abril@gmail.com>

* add channel_converted websocket event

Signed-off-by: Saturnino Abril <saturnino.abril@gmail.com>

* only send channel_id via websocket message for "channel_converted" event

Signed-off-by: Saturnino Abril <saturnino.abril@gmail.com>
2018-05-28 22:31:08 +08:00
Carlos Tadeu Panato Junior
c3e9c41440 [MM-1915] Add Deactivate Account - server side (#8699) 2018-05-28 16:20:08 +02:00
George Goldberg
7225abddee MM-8814: Remove implicit permission grants from post ownership. (#8391) 2018-05-28 09:46:52 -04:00
Martin Kraft
69304fb54d Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2 2018-05-24 08:40:52 -04:00
Jesse Hallam
847c181ec9 MM-8622: Improved plugin error reporting (#8737)
* allow `Wait()`ing on the supervisor

In the event the plugin supervisor shuts down a plugin for crashing too
many times, the new `Wait()` interface allows the `ActivatePlugin` to
accept a callback function to trigger when `supervisor.Wait()` returns.
If the supervisor shuts down normally, this callback is invoked with
a nil error, otherwise any error reported by the supervisor is passed
along.

* improve plugin activation/deactivation logic

Avoid triggering activation of previously failed-to-start plugins just
becase something in the configuration changed. Now, intelligently
compare the global enable bit as well as the each individual plugin's
enabled bit.

* expose store to manipulate PluginStatuses

* expose API to fetch plugin statuses

* keep track of whether or not plugin sandboxing is supported

* transition plugin statuses

* restore error on plugin activation if already active

* don't initialize test plugins until successfully loaded

* emit websocket events when plugin statuses change

* skip pruning if already initialized

* MM-8622: maintain plugin statuses in memory

Switch away from persisting plugin statuses to the database, and
maintain in memory instead. This will be followed by a cluster interface
to query the in-memory status of plugin statuses from all cluster nodes.

At the same time, rename `cluster_discovery_id` on the `PluginStatus`
model object to `cluster_id`.

* MM-8622: aggregate plugin statuses across cluster

* fetch cluster plugin statuses when emitting websocket notification

* address unit test fixes after rebasing

* relax (poor) racey unit test re: supervisor.Wait()

* make store-mocks
2018-05-23 14:26:35 -04:00
Martin Kraft
4c683aff76 Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2 2018-05-22 12:54:00 -04:00
Martin Kraft
eb78d273f3 Refactors migrations check. (#8814) 2018-05-21 12:10:26 +02:00
Balasankar C
d3ead7dc85 MM-10640 Set EnableUserCreation to true by default (#8815)
* Set EnableUserCreation to true by default

* Fix argument type to FormatBool

* Convert EnableUserCreation instances to pointer

* Convert to boolean in tests also

* Set value of pointer to be false

* Convert remaining EnableUserCreation instances to pointer
2018-05-18 09:57:30 -04:00
Joram Wilander
c6cbce6100 Add config setting for API team deletion (#8800) 2018-05-18 09:13:23 -04:00
Martin Kraft
e0390632b3 MM-10264: Adds CLI command to import and export permissions. (#8787)
* MM-10264: Adds CLI command to import and export permissions.

* MM-10264: Changes Scheme Name to DisplayName and adds Name slug field.

* MM-10264: Changes display name max size.

* MM-10264: Another merge fix.

* MM-10264: Changes for more Schemes methods checking for migration.

* MM-10264: More updates for Schemes migration checking.
2018-05-17 11:37:00 -04:00
George Goldberg
463065c8ba MM-10606: License feature flag for custom schemes. (#8804)
* MM-10606: Add new field to license for custom schemes.

* Add feature flag to license check for Schemes.
2018-05-17 16:29:31 +01:00
Martin Kraft
6f31d90e2f Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2 2018-05-17 07:53:16 -04:00
George Goldberg
319d61123a MM-10615: Reset teams/channels to default scheme on delete scheme. (#8811) 2018-05-17 12:48:31 +01:00
George Goldberg
c2ab85e0a3 MM-10591: Well known error for all scheme endpoints pre-migration. (#8812) 2018-05-17 12:48:18 +01:00
Joram Wilander
1f6c271b3b MM-8708 Remove api package (#8784)
* Remove api package

* Remove api dependency from cmd package

* Remove EnableAPIv3 setting

* Update web tests

* Add more websocket tests

* Move some ws and oauth tests to api4 package

* Move command tests into api4 package

* Test fixes

* Fix msg command test

* Add some app file tests
2018-05-16 13:43:22 -04:00
Martin Kraft
f82cc7896d Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2 2018-05-15 07:45:28 -04:00
Jesse Hallam
a1656dffa9 MM-10201: querystring for get slash commands (#8779)
* pass GET slash command payloads through query string

Previously, both GET and POST requests received the payload via the
body, but this was incorrect for GET requests. Now, the payloads for GET
requests is sent via the query string.

* reorder tests for clarity

* switch command tests to use httptest servers

* restore original test command endpoints
2018-05-14 13:24:22 -04:00
Joram Wilander
6a9aa855d1 Move SAML endpoints out of api package (#8780) 2018-05-14 11:27:30 -04:00
George Goldberg
51bd710ecd MM-9728: Online migration for advanced permissions phase 2 (#8744)
* MM-9728: Online migration for advanced permissions phase 2

* Add unit tests for new store functions.

* Move migration specific code to own file.

* Add migration state function test.

* Style fixes.

* Add i18n strings.

* Fix mocks.

* Add TestMain to migrations package tests.

* Fix typo.

* Fix review comments.

* Fix up the "Check if migration is done" check to actually work.
2018-05-14 15:59:04 +01:00
Joram Wilander
47250c6629 Refactor context out of API packages (#8755)
* Refactor context out of API packages

* Update function names per feedback

* Move webhook handlers to web and fix web tests

* Move more webhook tests out of api package

* Fix static handler
2018-05-14 10:24:58 -04:00
Martin Kraft
91557bbd97 Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2 2018-05-11 08:05:23 -04:00
Christopher Speller
d8dd271e43 MM-4998 Adding LoginIdAttribute to allow LDAP users to change their login ID without losing their account (#8756)
* Adding LoginIdAttribute

* Modifying LDAP to use loginIDAttribute.

* Adding IDAttribute migration and AD objectGUID support.

* Removing unused idea.

* Fix typo.
2018-05-10 09:46:09 -07:00
George Goldberg
11c60ea41a Merge branch 'master' into advanced-permissions-phase-2 2018-05-10 12:03:51 +01:00
Carlos Tadeu Panato Junior
db6b8f6238 fix test and add new (#8759) 2018-05-10 17:56:11 +08:00
Christopher Speller
454c113b4e Removing bad test. 2018-05-09 18:03:28 -07:00
Martin Kraft
d3e14a1bf8 Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2 2018-05-09 15:00:07 -04:00
Saturnino Abril
30fd4a2951 update permission of converting a channel from public to private to allow team admin (#8723) 2018-05-05 02:16:00 +08:00
George Goldberg
60cf74352f MM-10140: API Implementation for Schemes related Endpoints (#8615)
* Implement basic scheme CRUD endpoints.

* Get All Schemes (Paged) Endpoint and store plumbing.

* Add get teams/channels for schemes.

* Fix unit tests.

* Review fixes.

* More review fixes.
2018-05-03 09:00:26 -04:00
Joram Wilander
d6537deb3d Add inactive user count to analytics and fix client analytics function (#8695) 2018-05-02 07:50:56 -07:00
Martin Kraft
f4dcb4edf2 MM-10182 & MM-10183: Adds channel scheme and team scheme API endpoint. (#8680)
* MM-10183: Adds channel scheme API endpoint.

MM-10182: Adds team scheme API endpoint.

MM-10182_3: Switch from scheme_id in path to body.

* MM-10182/MM-10183: Changes path from 'schemes' to 'scheme'.

* MM-10182: Fix merge error.
2018-05-02 07:31:14 -04:00
Martin Kraft
ff6c42309c Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2 2018-05-01 18:59:20 -04:00
Saturnino Abril
30011f67e8 [MM-10354] Add feature to remove team icon (#8684)
* set team.LastTeamIconUpdate to 0 when removing team icon

* add APIv4 for removing team icon

* removed comment and updated typo on AppError
2018-04-30 17:57:57 +08:00
Christopher Speller
686c2fbab7 Structured logging (#8673)
* Implementing structured logging

* Changes to en.json to allow refactor to run.

* Fixing global logger

* Structured logger initalization.

* Add caller.

* Do some log redirection.

* Auto refactor

* Cleaning up l4g reference and removing dependancy.

* Removing junk.

* Copyright headers.

* Fixing tests

* Revert "Changes to en.json to allow refactor to run."

This reverts commit fd8249e99b.

* Fixing some auto refactor strangeness and typo.

* Making keys more human readable.
2018-04-27 12:49:45 -07:00
Corey Hulen
2acbc77d78 MM-10375 Fixing connected socket count (#8682)
* Fixing connected socket count

* Adding unit test
2018-04-27 10:38:40 -07:00